Class ccs.ArmatureAnimation

Class Summary
Constructor Attributes Constructor Name and Description
 
Base class for ccs.ArmatureAnimation objects.

Method Summary

Class Detail

ccs.ArmatureAnimation()
Base class for ccs.ArmatureAnimation objects.

Method Detail

  • callFrameEvent(args)
    call event
    Parameters:
    {Array} args
  • callMovementEvent(args)
    call event
    Parameters:
    {Array} args
  • <static> {ccs.ArmatureAnimation} ccs.ArmatureAnimation.create(armature)
    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 ignore
    Returns:
    {boolean}
  • play(animationName, durationTo, durationTween, loop, tweenEasing)
    play animation by animation name.
    Parameters:
    {Number} 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 by index, the other param is the same to play.
    Parameters:
    {Number} animationIndex
    {Number} durationTo
    {Number} durationTween
    {Number} loop
    {Number} tweenEasing
  • 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 ignore
    Parameters:
    {Boolean} bool
  • setMovementEventCallFunc(target, callFunc)
    connect a event
    Parameters:
    {Object} target
    {function} callFunc
  • setSpeedScale(speedScale)
    scale animation play speed
    Parameters:
    {Number} speedScale
  • setUserObject(aniData)
    userObject setter
    Parameters:
    {Object} aniData
  • updateHandler()
    update will call this handler, you can handle your logic here