cocos2d-x  3.0-alpha0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ArmatureAnimation Class Reference

#include <CCArmatureAnimation.h>

Inheritance diagram for ArmatureAnimation:
ProcessBase Object

Public Member Functions

 ArmatureAnimation ()
 ctor ()
 ArmatureAnimation ()
virtual ~ArmatureAnimation (void)
virtual bool init (Armature *armature)
 Init with a Armature. More...
 
var init ( var armature)
 Init with a Armature. More...
 
local init ( local armature)
 Init with a Armature. More...
 
virtual void setAnimationScale (float animationScale)
 Scale animation play speed. More...
 
var setAnimationScale ( var animationScale)
 Scale animation play speed. More...
 
local setAnimationScale ( local animationScale)
 Scale animation play speed. More...
 
virtual float getAnimationScale () const
var getAnimationScale ()
local getAnimationScale ()
virtual void setSpeedScale (float speedScale)
 Scale animation play speed. More...
 
local setSpeedScale ( local speedScale)
 Scale animation play speed. More...
 
virtual float getSpeedScale () const
var getSpeedScale ()
local getSpeedScale ()
virtual void setAnimationInternal (float animationInternal)
 The animation update speed. More...
 
var setAnimationInternal ( var animationInternal)
 The animation update speed. More...
 
local setAnimationInternal ( local animationInternal)
 The animation update speed. More...
 
void play (const char *animationName, int durationTo=-1, int durationTween=-1, int loop=-1, int tweenEasing=TWEEN_EASING_MAX)
 Play animation by animation name. More...
 
void playByIndex (int animationIndex, int durationTo=-1, int durationTween=-1, int loop=-1, int tweenEasing=TWEEN_EASING_MAX)
 Play animation by index, the other param is the same to play. More...
 
local playByIndex ( local animationIndex, local 1, local 1, local 1, local TWEEN_EASING_MAX)
 Play animation by index, the other param is the same to play. More...
 
virtual void pause ()
 Pause the Process. More...
 
var pause ()
 Pause the Process. More...
 
local pause ()
 Pause the Process. More...
 
virtual void resume ()
 Resume the Process. More...
 
var resume ()
 Resume the Process. More...
 
local resume ()
 Resume the Process. More...
 
virtual void stop ()
 Stop the Process. More...
 
var stop ()
 Stop the Process. More...
 
local stop ()
 Stop the Process. More...
 
int getMovementCount ()
 Get movement count. More...
 
void update (float dt)
 You should never call this function, unless you know what you do Update the Process, include current process, current frame and son on. More...
 
local update ( local dt)
 You should never call this function, unless you know what you do Update the Process, include current process, current frame and son on. More...
 
std::string getCurrentMovementID ()
 Get current movementID. More...
 
var getCurrentMovementID ()
 Get current movementID. More...
 
local getCurrentMovementID ()
 Get current movementID. More...
 
void setMovementEventCallFunc (Object *target, SEL_MovementEventCallFunc callFunc)
 Set armature's movement event callback function To disconnect this event, just setMovementEventCallFunc(NULL, NULL);. More...
 
void setFrameEventCallFunc (Object *target, SEL_FrameEventCallFunc callFunc)
 Set armature's frame event callback function To disconnect this event, just setFrameEventCallFunc(NULL, NULL);. More...
 
virtual AnimationDatagetAnimationData (void)
 getAnimationData More...
 
local getAnimationData ()
 getAnimationData More...
 
virtual void setAnimationData (AnimationData *var)
 setAnimationData More...
 
var setAnimationData ( var var)
 setAnimationData More...
 
local setAnimationData ( local var)
 setAnimationData More...
 
- Public Member Functions inherited from ProcessBase
 ProcessBase (void)
 ~ProcessBase (void)
virtual void play (void *animation, int durationTo, int durationTween, int loop, int tweenEasing)
 Play animation by animation name. More...
 
virtual void gotoFrame (int frameIndex)
virtual int getCurrentFrameIndex ()
- Public Member Functions inherited from Object
 Object ()
 Constructor. More...
 
virtual ~Object ()
void release ()
 Release the ownership immediately. More...
 
void retain ()
 Retains the ownership. More...
 
Objectautorelease ()
 Release the ownership sometime soon automatically. More...
 
bool isSingleReference () const
 Returns a boolean value that indicates whether there is only one reference to the object. More...
 
unsigned int retainCount () const
 Returns the object's current reference count. More...
 
virtual bool isEqual (const Object *object)
 Returns a boolean value that indicates whether this object and a given object are equal. More...
 
virtual void acceptVisitor (DataVisitor &visitor)

Static Public Member Functions

static ArmatureAnimationcreate (Armature *armature)
 Create with a Armature. More...
 

Public Attributes

float _speedScale
 Scale the animation speed. More...
 
MovementData_movementData
Armature_armature
 MovementData save all MovementFrameDatas this animation used. More...
 
var _armature
 MovementData save all MovementFrameDatas this animation used. More...
 
local _armature
 MovementData save all MovementFrameDatas this animation used. More...
 
std::string _movementID
 A weak reference of armature. More...
 
var _movementID
 A weak reference of armature. More...
 
local _movementID
 A weak reference of armature. More...
 
int _toIndex
 Current movment's name. More...
 
var _toIndex
 Current movment's name. More...
 
local _toIndex
 Current movment's name. More...
 
Array_tweenList
 The frame index in MovementData->m_pMovFrameDataArr, it's different from m_iFrameIndex. More...
 
- Public Attributes inherited from ProcessBase
virtual float getProcessScale (void)\n\n public
 getProcessScale More...
 
virtual bool getIsPause (void)\n\n public
 getIsPause More...
 
virtual bool getIsComplete (void)\n\n public
 getIsComplete More...
 
virtual bool getIsPlaying (void)\n\n public
 getIsPlaying More...
 
virtual float getCurrentPercent (void)\n\n public
 getCurrentPercent More...
 
virtual int getRawDuration (void)\n\n public
 getRawDuration More...
 
virtual AnimationType getLoopType (void)\n\n public
 getLoopType More...
 
virtual CCTweenType getTweenEasing (void)\n\n public
 getTweenEasing More...
 
virtual float getAnimationInternal (void)\n\n public
 getAnimationInternal More...
 
- Public Attributes inherited from Object
unsigned int _ID
 object id, ScriptSupport need public _ID More...
 
int _luaID
 Lua reference id. More...
 

Protected Member Functions

void updateHandler ()
 Update(float dt) will call this handler, you can handle your logic here. More...
 
void updateFrameData (float currentPercent)
 Update current key frame, and process auto stop, pause. More...
 
local updateFrameData ( local currentPercent)
 Update current key frame, and process auto stop, pause. More...
 
void frameEvent (Bone *bone, const char *frameEventName, int originFrameIndex, int currentFrameIndex)
 Emit a frame event. More...
 

Protected Attributes

AnimationData_animationData
 AnimationData save all MovementDatas this animation used. More...
 
var _animationData
 AnimationData save all MovementDatas this animation used. More...
 
local _animationData
 AnimationData save all MovementDatas this animation used. More...
 
SEL_MovementEventCallFunc _movementEventCallFunc
 MovementEvent CallFunc. More...
 
var _movementEventCallFunc
 MovementEvent CallFunc. More...
 
SEL_FrameEventCallFunc _frameEventCallFunc
 FrameEvent CallFunc. More...
 
var _frameEventCallFunc
 FrameEvent CallFunc. More...
 
local _frameEventCallFunc
 FrameEvent CallFunc. More...
 
Object_movementEventTarget
Object_frameEventTarget
- Protected Attributes inherited from ProcessBase
float _processScale
 Scale the process speed. More...
 
bool _isPause
 Set and get whether the aniamtion is pause. More...
 
bool _isComplete
 Set and get whether the aniamtion is complete. More...
 
bool _isPlaying
 Set and get whether the aniamtion is playing. More...
 
float _currentPercent
 Current percent this process arrived. More...
 
int _rawDuration
 The raw duration. More...
 
AnimationType _loopType
 The animation whether or not loop. More...
 
CCTweenType _tweenEasing
 The tween easing effect. More...
 
float _animationInternal
 The animation update speed. More...
 
int _durationTween
 The durantion frame count will run. More...
 
float _currentFrame
 Current frame this process arrived, this frame is tween frame. More...
 
int _curFrameIndex
 Frame index it the time line. More...
 
int _nextFrameIndex
 Next frame this process need run to. More...
 
bool _isLoopBack
- Protected Attributes inherited from Object
unsigned int _reference
 count of references More...
 
var _reference
 count of references More...
 
local _reference
 count of references More...
 
unsigned int _autoReleaseCount
 count of autorelease More...
 
var _autoReleaseCount
 count of autorelease More...
 
local _autoReleaseCount
 count of autorelease More...
 

Friends

class Tween

Constructor & Destructor Documentation

var ctor ( )
local ArmatureAnimation ( )
virtual ~ArmatureAnimation ( void  )
virtual

Member Function Documentation

static ArmatureAnimation* create ( Armature armature)
static

Create with a Armature.

Parameters
armatureThe Armature ArmatureAnimation will bind to
var create ( var  armature)
static

Create with a Armature.

Parameters
armatureThe Armature ArmatureAnimation will bind to
local create ( local  armature)
static

Create with a Armature.

Parameters
armatureThe Armature ArmatureAnimation will bind to
void frameEvent ( Bone bone,
const char *  frameEventName,
int  originFrameIndex,
int  currentFrameIndex 
)
protected

Emit a frame event.

var frameEvent ( var  bone,
var  frameEventName,
var  originFrameIndex,
var  currentFrameIndex 
)
protected

Emit a frame event.

local frameEvent ( local  bone,
local  frameEventName,
local  originFrameIndex,
local  currentFrameIndex 
)
protected

Emit a frame event.

virtual AnimationData*
getAnimationData
( void  )
virtual

getAnimationData

var getAnimationData (   )
virtual

getAnimationData

local getAnimationData (   )
virtual

getAnimationData

virtual float getAnimationScale ( ) const
virtual
var getAnimationScale ( )
virtual
local getAnimationScale ( )
virtual
std::string getCurrentMovementID ( )

Get current movementID.

Returns
The name of current movement
var getCurrentMovementID ( )

Get current movementID.

Returns
The name of current movement
local getCurrentMovementID ( )

Get current movementID.

Returns
The name of current movement
int getMovementCount ( )

Get movement count.

var getMovementCount ( )

Get movement count.

local getMovementCount ( )

Get movement count.

virtual float getSpeedScale ( ) const
virtual
var getSpeedScale ( )
virtual
local getSpeedScale ( )
virtual
virtual bool init ( Armature armature)
virtual

Init with a Armature.

Parameters
armatureThe Armature ArmatureAnimation will bind to
var init ( var  armature)
virtual

Init with a Armature.

Parameters
armatureThe Armature ArmatureAnimation will bind to
local init ( local  armature)
virtual

Init with a Armature.

Parameters
armatureThe Armature ArmatureAnimation will bind to
virtual void pause ( )
virtual

Pause the Process.

Reimplemented from ProcessBase.

var pause ( )
virtual

Pause the Process.

Reimplemented from ProcessBase.

local pause ( )
virtual

Pause the Process.

Reimplemented from ProcessBase.

void play ( const char *  animationName,
int  durationTo = -1,
int  durationTween = -1,
int  loop = -1,
int  tweenEasing = TWEEN_EASING_MAX 
)

Play animation by animation name.

Parameters
animationNameThe animation name you want to play
durationToThe frames between two animation changing-over. It's meaning is changing to this animation need how many frames

-1 : use the value from MovementData get from flash design panel

Parameters
durationTweenThe 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 MovementData get from flash design panel

Parameters
loopWhether the animation is loop
    loop < 0 : use the value from MovementData get from flash design panel
    loop = 0 : this animation is not loop
    loop > 0 : this animation is loop
tweenEasingTween easing is used for calculate easing effect
    TWEEN_EASING_MAX : use the value from MovementData get from flash design panel
    -1 : fade out
    0  : line
    1  : fade in
    2  : fade in and out
var play ( var  animationName,
var  durationTo = -1,
var  durationTween = -1,
var  loop = -1,
var  tweenEasing = TWEEN_EASING_MAX 
)

Play animation by animation name.

Parameters
animationNameThe animation name you want to play
durationToThe frames between two animation changing-over. It's meaning is changing to this animation need how many frames

-1 : use the value from MovementData get from flash design panel

Parameters
durationTweenThe 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 MovementData get from flash design panel

Parameters
loopWhether the animation is loop
    loop < 0 : use the value from MovementData get from flash design panel
    loop = 0 : this animation is not loop
    loop > 0 : this animation is loop
tweenEasingTween easing is used for calculate easing effect
    TWEEN_EASING_MAX : use the value from MovementData get from flash design panel
    -1 : fade out
    0  : line
    1  : fade in
    2  : fade in and out
local play ( local  animationName,
local  durationTo = -1,
local  durationTween = -1,
local  loop = -1,
local  tweenEasing = TWEEN_EASING_MAX 
)

Play animation by animation name.

Parameters
animationNameThe animation name you want to play
durationToThe frames between two animation changing-over. It's meaning is changing to this animation need how many frames

-1 : use the value from MovementData get from flash design panel

Parameters
durationTweenThe 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 MovementData get from flash design panel

Parameters
loopWhether the animation is loop
    loop < 0 : use the value from MovementData get from flash design panel
    loop = 0 : this animation is not loop
    loop > 0 : this animation is loop
tweenEasingTween easing is used for calculate easing effect
    TWEEN_EASING_MAX : use the value from MovementData get from flash design panel
    -1 : fade out
    0  : line
    1  : fade in
    2  : fade in and out
void playByIndex ( int  animationIndex,
int  durationTo = -1,
int  durationTween = -1,
int  loop = -1,
int  tweenEasing = TWEEN_EASING_MAX 
)

Play animation by index, the other param is the same to play.

Parameters
_animationIndexthe animation index you want to play
var playByIndex ( var  animationIndex,
var  durationTo = -1,
var  durationTween = -1,
var  loop = -1,
var  tweenEasing = TWEEN_EASING_MAX 
)

Play animation by index, the other param is the same to play.

Parameters
_animationIndexthe animation index you want to play
local playByIndex ( local  animationIndex,
local  durationTo = -1,
local  durationTween = -1,
local  loop = -1,
local  tweenEasing = TWEEN_EASING_MAX 
)

Play animation by index, the other param is the same to play.

Parameters
_animationIndexthe animation index you want to play
virtual void resume ( )
virtual

Resume the Process.

Reimplemented from ProcessBase.

var resume ( )
virtual

Resume the Process.

Reimplemented from ProcessBase.

local resume ( )
virtual

Resume the Process.

Reimplemented from ProcessBase.

virtual void setAnimationData ( AnimationData var)
virtual

setAnimationData

var setAnimationData ( var  var)
virtual

setAnimationData

local setAnimationData ( local  var)
virtual

setAnimationData

virtual void setAnimationInternal ( float  animationInternal)
virtual

The animation update speed.

var setAnimationInternal ( var  animationInternal)
virtual

The animation update speed.

local setAnimationInternal ( local  animationInternal)
virtual

The animation update speed.

virtual void setAnimationScale ( float  animationScale)
virtual

Scale animation play speed.

Parameters
animationScaleScale value
var setAnimationScale ( var  animationScale)
virtual

Scale animation play speed.

Parameters
animationScaleScale value
local setAnimationScale ( local  animationScale)
virtual

Scale animation play speed.

Parameters
animationScaleScale value
void setFrameEventCallFunc ( Object target,
SEL_FrameEventCallFunc  callFunc 
)

Set armature's frame event callback function To disconnect this event, just setFrameEventCallFunc(NULL, NULL);.

var setFrameEventCallFunc ( var  target,
var  callFunc 
)

Set armature's frame event callback function To disconnect this event, just setFrameEventCallFunc(NULL, NULL);.

local setFrameEventCallFunc ( local  target,
local  callFunc 
)

Set armature's frame event callback function To disconnect this event, just setFrameEventCallFunc(NULL, NULL);.

void setMovementEventCallFunc ( Object target,
SEL_MovementEventCallFunc  callFunc 
)

Set armature's movement event callback function To disconnect this event, just setMovementEventCallFunc(NULL, NULL);.

var setMovementEventCallFunc ( var  target,
var  callFunc 
)

Set armature's movement event callback function To disconnect this event, just setMovementEventCallFunc(NULL, NULL);.

local setMovementEventCallFunc ( local  target,
local  callFunc 
)

Set armature's movement event callback function To disconnect this event, just setMovementEventCallFunc(NULL, NULL);.

virtual void setSpeedScale ( float  speedScale)
virtual

Scale animation play speed.

Parameters
animationScaleScale value
var setSpeedScale ( var  speedScale)
virtual

Scale animation play speed.

Parameters
animationScaleScale value
local setSpeedScale ( local  speedScale)
virtual

Scale animation play speed.

Parameters
animationScaleScale value
virtual void stop ( )
virtual

Stop the Process.

Reimplemented from ProcessBase.

var stop ( )
virtual

Stop the Process.

Reimplemented from ProcessBase.

local stop ( )
virtual

Stop the Process.

Reimplemented from ProcessBase.

void update ( float  dt)
virtual

You should never call this function, unless you know what you do Update the Process, include current process, current frame and son on.

Parameters
Theduration since last update

Reimplemented from ProcessBase.

var update ( var  dt)
virtual

You should never call this function, unless you know what you do Update the Process, include current process, current frame and son on.

Parameters
Theduration since last update

Reimplemented from ProcessBase.

local update ( local  dt)
virtual

You should never call this function, unless you know what you do Update the Process, include current process, current frame and son on.

Parameters
Theduration since last update

Reimplemented from ProcessBase.

void updateFrameData ( float  currentPercent)
protected

Update current key frame, and process auto stop, pause.

var updateFrameData ( var  currentPercent)
protected

Update current key frame, and process auto stop, pause.

local updateFrameData ( local  currentPercent)
protected

Update current key frame, and process auto stop, pause.

void updateHandler ( )
protectedvirtual

Update(float dt) will call this handler, you can handle your logic here.

Reimplemented from ProcessBase.

var updateHandler ( )
protectedvirtual

Update(float dt) will call this handler, you can handle your logic here.

Reimplemented from ProcessBase.

local updateHandler ( )
protectedvirtual

Update(float dt) will call this handler, you can handle your logic here.

Reimplemented from ProcessBase.

Friends And Related Function Documentation

friend class Tween
friend

Member Data Documentation

AnimationData* _animationData
protected

AnimationData save all MovementDatas this animation used.

var _animationData
protected

AnimationData save all MovementDatas this animation used.

local _animationData
protected

AnimationData save all MovementDatas this animation used.

Armature* _armature

MovementData save all MovementFrameDatas this animation used.

var _armature

MovementData save all MovementFrameDatas this animation used.

local _armature

MovementData save all MovementFrameDatas this animation used.

SEL_FrameEventCallFunc
_frameEventCallFunc
protected

FrameEvent CallFunc.

Parameters
Bone*,aBone
constchar*, the name of this frame event
int,originframe index
int,currentframe index, animation may be delayed
var _frameEventCallFunc
protected

FrameEvent CallFunc.

Parameters
Bone*,aBone
constchar*, the name of this frame event
int,originframe index
int,currentframe index, animation may be delayed
local _frameEventCallFunc
protected

FrameEvent CallFunc.

Parameters
Bone*,aBone
constchar*, the name of this frame event
int,originframe index
int,currentframe index, animation may be delayed
Object* _frameEventTarget
protected
var _frameEventTarget
protected
local _frameEventTarget
protected
MovementData* _movementData
var _movementData
local _movementData
SEL_MovementEventCallFunc
_movementEventCallFunc
protected

MovementEvent CallFunc.

Parameters
Armature*a Armature
MovementEventType,EventType, like START, COMPLETE.
constchar*, Movement ID, also called Movement Name
var _movementEventCallFunc
protected

MovementEvent CallFunc.

Parameters
Armature*a Armature
MovementEventType,EventType, like START, COMPLETE.
constchar*, Movement ID, also called Movement Name
local _movementEventCallFunc
protected

MovementEvent CallFunc.

Parameters
Armature*a Armature
MovementEventType,EventType, like START, COMPLETE.
constchar*, Movement ID, also called Movement Name
Object* _movementEventTarget
protected
var _movementEventTarget
protected
local _movementEventTarget
protected
std::string _movementID

A weak reference of armature.

var _movementID

A weak reference of armature.

local _movementID

A weak reference of armature.

float _speedScale

Scale the animation speed.

var _speedScale

Scale the animation speed.

local _speedScale

Scale the animation speed.

int _toIndex

Current movment's name.

var _toIndex

Current movment's name.

local _toIndex

Current movment's name.

Array* _tweenList

The frame index in MovementData->m_pMovFrameDataArr, it's different from m_iFrameIndex.

var _tweenList

The frame index in MovementData->m_pMovFrameDataArr, it's different from m_iFrameIndex.

local _tweenList

The frame index in MovementData->m_pMovFrameDataArr, it's different from m_iFrameIndex.


The documentation for this class was generated from the following file: