Cocos Creator API

1.4.x

Cocos Creator is a highly customizable game development tool that utilizes the power of cocos2d-x.

AnimationState

Extends AnimationNode
Module: cc

The AnimationState gives full control over animation playback process. In most cases the Animation Component is sufficient and easier to use. Use the AnimationState if you need full control.

Properties

clip AnimationClip readOnly

The clip that is being played by this animation state.

name String readOnly

The name of the playing animation.

curves AnimCurve

Inherited from AnimationNode:

The curves list.

delay Number

Inherited from AnimationNode:

The start delay which represents the number of seconds from an animation's start time to the start of the active interval.

repeatCount Number

Inherited from AnimationNode:

The animation's iteration count property.

A real number greater than or equal to zero (including positive infinity) representing the number of times to repeat the animation node.

Values less than zero and NaN values are treated as the value 1.0 for the purpose of timing model calculations.

duration Number readOnly

Inherited from AnimationNode:

The iteration duration of this animation in seconds. (length)

speed Number

Inherited from AnimationNode:

The animation's playback speed. 1 is normal playback speed.

wrapMode WrapMode

Inherited from AnimationNode:

Wrapping mode of the playing animation. Notice : dynamic change wrapMode will reset time and repeatCount property

time Number

Inherited from AnimationNode:

The current time of this animation in seconds.

isPlaying Boolean readOnly

Inherited from Playable:

Is playing or paused in play mode?

isPaused Boolean readOnly

Inherited from Playable:

Is currently paused? This can be true even if in edit mode(isPlaying == false).

There are no properties that match your current filter settings. You can change your filter settings in the index section on this page. index

Methods

AnimationState
(
  • clip
  • [name ]
)
AnimationState

name type description
clip AnimationClip
name optional String

returns:

update
(
  • deltaTime
)
private

Inherited from AnimationNodeBase:

name type description
deltaTime Number

onPlay ( ) private

Inherited from Playable:

onPause ( ) private

Inherited from Playable:

onResume ( ) private

Inherited from Playable:

onStop ( ) private

Inherited from Playable:

onError
(
  • errorCode
)
private

Inherited from Playable:

name type description
errorCode string

play ( )

Inherited from Playable:

Play this animation.

stop ( )

Inherited from Playable:

Stop this animation.