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

#include <CCTween.h>

Inheritance diagram for Tween:
ProcessBase Object

Public Member Functions

 Tween (void)
virtual ~Tween (void)
virtual bool init (Bone *bone)
 Init with a Bone. More...
 
local init ( local bone)
 Init with a Bone. More...
 
virtual void play (MovementBoneData *movementBoneData, int durationTo, int durationTween, int loop, int tweenEasing)
 Start the Process. More...
 
local play ( local movementBoneData, local durationTo, local durationTween, local loop, local tweenEasing)
 Start the Process. More...
 
void setAnimation (ArmatureAnimation *animation)
ArmatureAnimationgetAnimation () const
local getAnimation ()
- 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 pause ()
 Pause the Process. More...
 
virtual void resume ()
 Resume the Process. More...
 
virtual void stop ()
 Stop the Process. More...
 
virtual void gotoFrame (int frameIndex)
virtual 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...
 
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 Tweencreate (Bone *bone)
 Create with a Bone. More...
 
local create ( local bone)
 Create with a Bone. More...
 

Public Attributes

virtual MovementBoneData
*getMovementBoneData(void)\n\n
public FrameData
_tweenData
 getMovementBoneData More...
 
FrameData_from
 The computational tween frame data, //! A weak reference to the Bone's tweenData. More...
 
var _from
 The computational tween frame data, //! A weak reference to the Bone's tweenData. More...
 
local _from
 The computational tween frame data, //! A weak reference to the Bone's tweenData. More...
 
FrameData_to
 From frame data, used for calculate between value. More...
 
FrameData_between
 To frame data, used for calculate between value. More...
 
var _between
 To frame data, used for calculate between value. More...
 
local _between
 To frame data, used for calculate between value. More...
 
Bone_bone
 Between frame data, used for calculate current FrameData(m_pNode) value. More...
 
var _bone
 Between frame data, used for calculate current FrameData(m_pNode) value. More...
 
local _bone
 Between frame data, used for calculate current FrameData(m_pNode) value. More...
 
CCTweenType _frameTweenEasing
 A weak reference to the Bone. More...
 
var _frameTweenEasing
 A weak reference to the Bone. More...
 
local _frameTweenEasing
 A weak reference to the Bone. More...
 
int _betweenDuration
 Dedermine which tween effect current frame use. More...
 
var _betweenDuration
 Dedermine which tween effect current frame use. More...
 
local _betweenDuration
 Dedermine which tween effect current frame use. More...
 
int _totalDuration
 Current key frame will last _betweenDuration frames. More...
 
var _totalDuration
 Current key frame will last _betweenDuration frames. More...
 
local _totalDuration
 Current key frame will last _betweenDuration frames. More...
 
int _fromIndex
var _fromIndex
local _fromIndex
int _toIndex
 The current frame index in FrameList of MovementBoneData, it's different from m_iFrameIndex. More...
 
var _toIndex
 The current frame index in FrameList of MovementBoneData, it's different from m_iFrameIndex. More...
 
local _toIndex
 The current frame index in FrameList of MovementBoneData, it's different from m_iFrameIndex. More...
 
ArmatureAnimation_animation
 The next frame index in FrameList of MovementBoneData, it's different from m_iFrameIndex. More...
 
var _animation
 The next frame index in FrameList of MovementBoneData, it's different from m_iFrameIndex. More...
 
local _animation
 The next frame index in FrameList of MovementBoneData, 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

virtual void updateHandler ()
 Update(float dt) will call this handler, you can handle your logic here. More...
 
var updateHandler ()
 Update(float dt) will call this handler, you can handle your logic here. More...
 
local updateHandler ()
 Update(float dt) will call this handler, you can handle your logic here. More...
 
virtual float updateFrameData (float currentPercent)
 Calculate which frame arrived, and if current frame have event, then call the event listener. More...
 
local updateFrameData ( local currentPercent)
 Calculate which frame arrived, and if current frame have event, then call the event listener. More...
 
virtual void setBetween (FrameData *from, FrameData *to, bool limit=true)
 Calculate the between value of _from and _to, and give it to between frame data. More...
 
var setBetween ( var from, var to, var true)
 Calculate the between value of _from and _to, and give it to between frame data. More...
 
local setBetween ( local from, local to, local true)
 Calculate the between value of _from and _to, and give it to between frame data. More...
 
virtual FrameDatatweenNodeTo (float percent, FrameData *node=NULL)
 According to the percent to calculate current FrameData with tween effect. More...
 
local tweenNodeTo ( local percent, local NULL)
 According to the percent to calculate current FrameData with tween effect. More...
 
virtual void tweenColorTo (float percent, FrameData *node)
 According to the percent to calculate current color with tween effect. More...
 
var tweenColorTo ( var percent, var node)
 According to the percent to calculate current color with tween effect. More...
 
local tweenColorTo ( local percent, local node)
 According to the percent to calculate current color with tween effect. More...
 
virtual void arriveKeyFrame (FrameData *keyFrameData)
 Update display index and process the key frame event when arrived a key frame. More...
 

Protected Attributes

MovementBoneData_movementBoneData
 A weak reference to the current MovementBoneData. The data is in the data pool. More...
 
- 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...
 

Constructor & Destructor Documentation

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

Member Function Documentation

virtual void arriveKeyFrame ( FrameData keyFrameData)
protectedvirtual

Update display index and process the key frame event when arrived a key frame.

var arriveKeyFrame ( var  keyFrameData)
protectedvirtual

Update display index and process the key frame event when arrived a key frame.

local arriveKeyFrame ( local  keyFrameData)
protectedvirtual

Update display index and process the key frame event when arrived a key frame.

static Tween* create ( Bone bone)
static

Create with a Bone.

Parameters
bonethe Bone Tween will bind to
var create ( var  bone)
static

Create with a Bone.

Parameters
bonethe Bone Tween will bind to
local create ( local  bone)
static

Create with a Bone.

Parameters
bonethe Bone Tween will bind to
ArmatureAnimation* getAnimation ( ) const
inline
var getAnimation ( )
inline
local getAnimation ( )
inline
virtual bool init ( Bone bone)
virtual

Init with a Bone.

Parameters
bonethe Bone Tween will bind to
var init ( var  bone)
virtual

Init with a Bone.

Parameters
bonethe Bone Tween will bind to
local init ( local  bone)
virtual

Init with a Bone.

Parameters
bonethe Bone Tween will bind to
virtual void play ( MovementBoneData movementBoneData,
int  durationTo,
int  durationTween,
int  loop,
int  tweenEasing 
)
virtual

Start the Process.

Parameters
movementBoneDatathe MovementBoneData include all FrameData
durationTothe number of frames changing to this animation needs.
durationTweenthe number of frames this animation actual last.
loopwhether the animation is loop
    loop < 0 : use the value from MovementData get from Action Editor
    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 Action Editor
    -1 : fade out
    0  : line
    1  : fade in
    2  : fade in and out
var play ( var  movementBoneData,
var  durationTo,
var  durationTween,
var  loop,
var  tweenEasing 
)
virtual

Start the Process.

Parameters
movementBoneDatathe MovementBoneData include all FrameData
durationTothe number of frames changing to this animation needs.
durationTweenthe number of frames this animation actual last.
loopwhether the animation is loop
    loop < 0 : use the value from MovementData get from Action Editor
    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 Action Editor
    -1 : fade out
    0  : line
    1  : fade in
    2  : fade in and out
local play ( local  movementBoneData,
local  durationTo,
local  durationTween,
local  loop,
local  tweenEasing 
)
virtual

Start the Process.

Parameters
movementBoneDatathe MovementBoneData include all FrameData
durationTothe number of frames changing to this animation needs.
durationTweenthe number of frames this animation actual last.
loopwhether the animation is loop
    loop < 0 : use the value from MovementData get from Action Editor
    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 Action Editor
    -1 : fade out
    0  : line
    1  : fade in
    2  : fade in and out
void setAnimation ( ArmatureAnimation animation)
inline
var setAnimation ( var  animation)
inline
local setAnimation ( local  animation)
inline
virtual void setBetween ( FrameData from,
FrameData to,
bool  limit = true 
)
protectedvirtual

Calculate the between value of _from and _to, and give it to between frame data.

var setBetween ( var  from,
var  to,
var  limit = true 
)
protectedvirtual

Calculate the between value of _from and _to, and give it to between frame data.

local setBetween ( local  from,
local  to,
local  limit = true 
)
protectedvirtual

Calculate the between value of _from and _to, and give it to between frame data.

virtual void tweenColorTo ( float  percent,
FrameData node 
)
protectedvirtual

According to the percent to calculate current color with tween effect.

var tweenColorTo ( var  percent,
var  node 
)
protectedvirtual

According to the percent to calculate current color with tween effect.

local tweenColorTo ( local  percent,
local  node 
)
protectedvirtual

According to the percent to calculate current color with tween effect.

virtual FrameData* tweenNodeTo ( float  percent,
FrameData node = NULL 
)
protectedvirtual

According to the percent to calculate current FrameData with tween effect.

var tweenNodeTo ( var  percent,
var  node = NULL 
)
protectedvirtual

According to the percent to calculate current FrameData with tween effect.

local tweenNodeTo ( local  percent,
local  node = NULL 
)
protectedvirtual

According to the percent to calculate current FrameData with tween effect.

virtual float updateFrameData ( float  currentPercent)
protectedvirtual

Calculate which frame arrived, and if current frame have event, then call the event listener.

var updateFrameData ( var  currentPercent)
protectedvirtual

Calculate which frame arrived, and if current frame have event, then call the event listener.

local updateFrameData ( local  currentPercent)
protectedvirtual

Calculate which frame arrived, and if current frame have event, then call the event listener.

virtual 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.

Member Data Documentation

ArmatureAnimation* _animation

The next frame index in FrameList of MovementBoneData, it's different from m_iFrameIndex.

var _animation

The next frame index in FrameList of MovementBoneData, it's different from m_iFrameIndex.

local _animation

The next frame index in FrameList of MovementBoneData, it's different from m_iFrameIndex.

FrameData* _between

To frame data, used for calculate between value.

var _between

To frame data, used for calculate between value.

local _between

To frame data, used for calculate between value.

int _betweenDuration

Dedermine which tween effect current frame use.

var _betweenDuration

Dedermine which tween effect current frame use.

local _betweenDuration

Dedermine which tween effect current frame use.

Bone* _bone

Between frame data, used for calculate current FrameData(m_pNode) value.

var _bone

Between frame data, used for calculate current FrameData(m_pNode) value.

local _bone

Between frame data, used for calculate current FrameData(m_pNode) value.

CCTweenType _frameTweenEasing

A weak reference to the Bone.

var _frameTweenEasing

A weak reference to the Bone.

local _frameTweenEasing

A weak reference to the Bone.

FrameData* _from

The computational tween frame data, //! A weak reference to the Bone's tweenData.

var _from

The computational tween frame data, //! A weak reference to the Bone's tweenData.

local _from

The computational tween frame data, //! A weak reference to the Bone's tweenData.

int _fromIndex
var _fromIndex
local _fromIndex
MovementBoneData* _movementBoneData
protected

A weak reference to the current MovementBoneData. The data is in the data pool.

FrameData* _to

From frame data, used for calculate between value.

var _to

From frame data, used for calculate between value.

local _to

From frame data, used for calculate between value.

int _toIndex

The current frame index in FrameList of MovementBoneData, it's different from m_iFrameIndex.

var _toIndex

The current frame index in FrameList of MovementBoneData, it's different from m_iFrameIndex.

local _toIndex

The current frame index in FrameList of MovementBoneData, it's different from m_iFrameIndex.

int _totalDuration

Current key frame will last _betweenDuration frames.

var _totalDuration

Current key frame will last _betweenDuration frames.

local _totalDuration

Current key frame will last _betweenDuration frames.

virtual MovementBoneData*
getMovementBoneData (void)\n
\n public FrameData*
_tweenData

getMovementBoneData

setMovementBoneData

var _tweenData

getMovementBoneData

setMovementBoneData

local _tweenData

getMovementBoneData

setMovementBoneData


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