Class ccs.ArmatureAnimation
- Defined in: CCArmatureAnimation.js
- Extends ccs.ProcessBase
Constructor Attributes | Constructor Name and Description |
---|---|
Base class for ccs.ArmatureAnimation objects.
|
Method Summary
Class Detail
ccs.ArmatureAnimation()
Base class for ccs.ArmatureAnimation objects.
Field Detail
{ccs.AnimationData}
animationData
- Animation data
{Number}
animationScale
- Animation play speed scale
{Boolean}
ignoreFrameEvent
- Indicate whether the frame event is ignored
{Number}
speedScale
- Animation play speed scale
{Object}
userObject
- User custom object
Method Detail
-
callFrameEvent(args)call event
- Parameters:
- {Array} args
-
callMovementEvent(args)call event
- Parameters:
- {Array} args
-
allocates and initializes a ArmatureAnimation.
// example var animation = ccs.ArmatureAnimation.create();
- Parameters:
- armature
- Returns:
- {ccs.ArmatureAnimation}
-
frameEvent(bone, frameEventName, originFrameIndex, currentFrameIndex)
- Parameters:
- {ccs.Bone} bone
- {String} frameEventName
- {Number} originFrameIndex
- {Number} currentFrameIndex
-
{ccs.AnimationData} getAnimationData()animationData getter
- Returns:
- {ccs.AnimationData}
-
{String} getCurrentMovementID()Get current movementID
- Returns:
- {String}
-
{Number} getMovementCount()get movement count
- Returns:
- {Number}
-
{Object} getUserObject()userObject getter
- Returns:
- {Object}
-
gotoAndPause(frameIndex)Go to specified frame and pause current movement.
- Parameters:
- {Number} frameIndex
-
gotoAndPlay(frameIndex)Go to specified frame and play current movement. You need first switch to the movement you want to play, then call this function. example : playByIndex(0); gotoAndPlay(0); playByIndex(1); gotoAndPlay(0); gotoAndPlay(15);
- Parameters:
- {Number} frameIndex
-
{Boolean} init(armature)init with a CCArmature
- Parameters:
- {ccs.Armature} armature
- Returns:
- {Boolean}
-
{boolean} isIgnoreFrameEvent()Determines if the frame event is ignored
- Returns:
- {boolean}
-
play(animationName, durationTo, durationTween, loop, tweenEasing)play animation by animation name.
// example armature.getAnimation().play("run",-1,-1,1,-1);//loop play armature.getAnimation().play("run",-1,-1,0,-1);//not loop play
- Parameters:
- {String} animationName
- The animation name you want to play
- {Number} durationTo
- he frames between two animation changing-over.It's meaning is changing to this animation need how many frames -1 : use the value from CCMovementData get from flash design panel
- {Number} durationTween
- he frame count you want to play in the game.if _durationTween is 80, then the animation will played 80 frames in a loop -1 : use the value from CCMovementData get from flash design panel
- {Number} loop
- Whether the animation is loop. loop < 0 : use the value from CCMovementData get from flash design panel loop = 0 : this animation is not loop loop > 0 : this animation is loop
- {Number} tweenEasing
- CCTween easing is used for calculate easing effect TWEEN_EASING_MAX : use the value from CCMovementData get from flash design panel -1 : fade out 0 : line 1 : fade in 2 : fade in and out
-
playByIndex(animationIndex, durationTo, durationTween, loop, tweenEasing)Play animation with index, the o ther param is the same to play.
- Parameters:
- {Number} animationIndex
- {Number} durationTo
- {Number} durationTween
- {Number} loop
- {Number} tweenEasing
-
playWithIndex(animationIndex, durationTo, durationTween, loop, tweenEasing)Play animation with index, the other param is the same to play.
- Parameters:
- {Number||Array} animationIndex
- {Number} durationTo
- {Number} durationTween
- {Number} loop
- {Number} tweenEasing
-
playWithIndexes(movementIndexes, durationTo, loop)play by indexes
- Parameters:
- movementIndexes
- {Number} durationTo
- {Boolean} loop
-
playWithNames(movementNames, durationTo, loop)play with names
- Parameters:
- {Array} movementNames
- {Number} durationTo
- {Boolean} loop
-
setAnimationData(aniData)animationData setter
- Parameters:
- {ccs.AnimationData} aniData
-
setFrameEventCallFunc(target, callFunc)connect a event
- Parameters:
- {Object} target
- {function} callFunc
-
setIgnoreFrameEvent(bool)Sets whether the frame event is ignored
- Parameters:
- {Boolean} bool
-
setMovementEventCallFunc(target, callFunc)connect a event
- Parameters:
- {Object} target
- {function} callFunc
-
setSpeedScale(speedScale)scale animation play speed
- Parameters:
- {Number} speedScale
-
setUserObject(userObject)userObject setter
- Parameters:
- {Object} userObject
-
updateHandler()update will call this handler, you can handle your logic here