Constructor
new AnimationPlayer()
Create a
AnimationPlayer
Example。
Extends
Member
_fullFrames :Array
cacheFrameRate :int
Gets the default frame rate *
cacheFrameRateInterval :Number
Gets the buffer frame rate interval
cachePlayRate :Number
Gets cache playback speed. *
currentAnimationClipIndex :int
Gets the current animation index
currentFrameTime :Number
Gets the current frame time, excluding replay time
currentKeyframeIndex :int
Get the current frame
currentPlayTime :Number
Gets the current exact time, not including replay time
currentTime :Number
destroyed :Boolean
Gets or if it has been destroyed.
isCache :Boolean
Cache?
overallDuration :Number
Gets the total amount of time the animation is played
paused :Boolean
Gets the current pause
playbackRate :Number
Playback speed
- Default Value:
- 1.0
playDuration :Number
Gets the total amount of time an animation is played
playEnd :Number
The end time position of animation playback.
playStart :Number
The starting time and position of animation.
returnToZeroStopped :Boolean
Is zero when stopped?
state :int
Gets the current play state
Methods
event(type, dataopt) → {Boolean}
Dispatch events.
- Inherited From:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type |
String
|
Event type. | ||
data |
Object
|
<optional> |
null | data (optional) callback data. Be careful: If you need to pass multiple parameters, P1, P2, P3, you can use the array structure, such as: [p1,p2,p3,...] If you need to call a single parameter P, and P is an array, you need to use a structure such as: [p] Other single parameters, P, can be passed directly to the parameter P. |
Returns:
- Type:
-
Boolean
Is there a listener for this event type? If there is a listener, the value is true, otherwise the value is false.
hasListener(type) → {Boolean}
inspect EventDispatcher Object registers any listeners for a particular event type.
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
type |
String
|
Event type. |
Returns:
- Type:
-
Boolean
If the specified type of listener has been registered, the value is true; otherwise, the value is false.
isMouseEvent(type) → {Boolean}
Detects whether the specified event type is a mouse event.
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
type |
String
|
Event type. |
Returns:
- Type:
-
Boolean
If it is a mouse event, the value is true; otherwise, the value is false.
off(type, caller, listener, onceOnly) → {EventDispatcher}
from EventDispatcher Delete listeners in object.
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
type |
String
|
Event type. |
caller |
Object
|
The domain of the event listener function. |
listener |
function
|
Event listener function. |
onceOnly |
Boolean
|
(optional) if the value is true, only the listeners added by the once method are removed. |
offAll(typeopt) → {EventDispatcher}
from EventDispatcher Removes all listeners that specify the type of event in the object.
- Inherited From:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type |
String
|
<optional> |
null | type (optional) event type. If the value is null, all types of listeners for this object are removed. |
on(type, caller, listener, argsopt) → {EventDispatcher}
Use EventDispatcher Object registers the event listener object of the specified type so that listeners can receive event notifications.
- Inherited From:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type |
String
|
Event type. | ||
caller |
Object
|
The domain of the event listener function. | ||
listener |
function
|
Event listener function. | ||
args |
Array
|
<optional> |
null | args Optional callback parameters for the event listener function. |
once(type, caller, listener, argsopt) → {EventDispatcher}
Use EventDispatcher Object registers the event listener object of the specified type so that the listener can receive the event notification, which is automatically removed after a response event.
- Inherited From:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type |
String
|
Event type. | ||
caller |
Object
|
The domain of the event listener function. | ||
listener |
function
|
Event listener function. | ||
args |
Array
|
<optional> |
null | args Optional callback parameters for the event listener function. |
play(indexopt, playbackRateopt, overallDurationopt, playStartopt, playEndopt)
Play animation.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
index |
int
|
<optional> |
0 | index Animation index. |
playbackRate |
Number
|
<optional> |
1.0 | playbackRate Playback speed. |
overallDuration |
int
|
<optional> |
2147483647 | duration Play long (0 for 1 times, Number.MAX_VALUE for loop play). |
playStart |
Number
|
<optional> |
0 | playStart Play start time position. |
playEnd |
Number
|
<optional> |
0 | playEnd End of play time position. (0 is the longest ending position of an animation cycle). |
playByFrame(indexopt, playbackRateopt, overallDurationopt, playStartFrameopt, playEndFrameopt)
Play animation.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
index |
int
|
<optional> |
0 | index Animation index. |
playbackRate |
Number
|
<optional> |
1.0 | playbackRate Playback speed. |
overallDuration |
Number
|
<optional> |
2147483647 | duration Play long (0 for 1 times, Number.MAX_VALUE for loop play). |
playStartFrame |
Number
|
<optional> |
0 | playStartFrame The original start frame rate for playback. |
playEndFrame |
Number
|
<optional> |
0 | playEndFrame Play the original end frame rate position. (0 is the longest ending position of an animation cycle). |
stop(immediate)
Stop playing current animation
Parameters:
Name | Type | Description |
---|---|---|
immediate |
Boolean
|
Do you want to stop now? |
Event
complete
- See:
-
- events.Event
paused
- See:
-
- events.Event
played
- See:
-
- events.Event
stopped
- See:
-
- events.Event