cocos2d-x 3.0
- 首页 - 相关页面 - 模块 - 命名空间 - - 文件 -
Public 成员函数 - 图1 Public 成员函数 - 图2)
- 类列表 - 类索引 - 类继承关系 - 类成员

全部)) 命名空间) 文件) 函数) 变量) 类型定义) 枚举) 枚举值) 属性) 友元) 宏定义)))

Public 成员函数 | 静态 Public 成员函数 | Protected 成员函数 | Protected 属性 | 所有成员列表

Tween类 参考

NA NA 更多…

#include

类 Tween 继承关系图:

Public 成员函数 - 图3 ProcessBase Ref

## Public 成员函数
Tween (void)
virtual ~Tween (void)
virtual bool init (Bone bone)
Init with a Bone. 更多…
virtual void play (MovementBoneData movementBoneData, int durationTo, int durationTween, int loop, int tweenEasing)
Start the Process. 更多…
void setAnimation (ArmatureAnimation animation)
ArmatureAnimation getAnimation () const
virtual void gotoAndPlay (int frameIndex)
virtual void gotoAndPause (int frameIndex)
virtual void setMovementBoneData (MovementBoneData data)
virtual const MovementBoneData getMovementBoneData () const
- Public 成员函数 继承自 ProcessBase
ProcessBase (void)
virtual ~ProcessBase (void)
virtual void play (int durationTo, int durationTween, int loop, int tweenEasing)
通过动画名称播放动画 更多…
virtual void pause ()
暂停进程 更多…
virtual void resume ()
恢复进程 更多…
virtual void stop ()
停止进程 更多…
virtual void update (float dt)
不应该调用这个函数,除非你知道你做了什么 更新进程,包括当前进程,当前帧和子帧 更多…
virtual int getCurrentFrameIndex ()
virtual void setProcessScale (float processScale)
virtual float getProcessScale () const
virtual void setIsPause (bool pause)
virtual bool isPause () const
virtual void setIsComplete (bool complete)
virtual bool isComplete () const
virtual void setIsPlaying (bool playing)
virtual bool isPlaying () const
virtual float getCurrentPercent () const
virtual int getRawDuration () const
- Public 成员函数 继承自 Ref
void retain ()
保留所有权. 更多…
void release ()
立即释放所有权. 更多…
Ref * autorelease ()
自动释放所有权在不久的将来. 更多…
unsigned int getReferenceCount () const
返回Ref对象当前的引用计数. 更多…
virtual ~Ref ()
NA NA 更多…
## 静态 Public 成员函数
static Tween create (Bone bone)
Create with a Bone. 更多…
## Protected 成员函数
virtual void updateHandler ()
Update(float dt) will call this handler, you can handle your logic here. 更多…
virtual float updateFrameData (float currentPercent)
Calculate which frame arrived, and if current frame have event, then call the event listener. 更多…
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. 更多…
virtual FrameData tweenNodeTo (float percent, FrameData node=nullptr)
According to the percent to calculate current FrameData with tween effect. 更多…
virtual void tweenColorTo (float percent, FrameData node)
According to the percent to calculate current color with tween effect. 更多…
virtual void arriveKeyFrame (FrameData keyFrameData)
Update display index and process the key frame event when arrived a key frame. 更多…
- Protected 成员函数 继承自 ProcessBase
virtual void gotoFrame (int frameIndex)
- Protected 成员函数 继承自 Ref
Ref ()
构造函数 更多…
## Protected 属性
MovementBoneData _movementBoneData
A weak reference to the current MovementBoneData. The data is in the data pool. 更多…
FrameData _tweenData
FrameData _from
The computational tween frame data, //! A weak reference to the Bone's tweenData. 更多…
FrameData _to
From frame data, used for calculate between value. 更多…
FrameData _between
To frame data, used for calculate between value. 更多…
Bone _bone
Between frame data, used for calculate current FrameData(m_pNode) value. 更多…
TweenType _frameTweenEasing
A weak reference to the Bone. 更多…
int _betweenDuration
Dedermine which tween effect current frame use. 更多…
int _totalDuration
Current key frame will last _betweenDuration frames. 更多…
int _fromIndex
int _toIndex
The current frame index in FrameList of MovementBoneData, it's different from m_iFrameIndex. 更多…
ArmatureAnimation * _animation
The next frame index in FrameList of MovementBoneData, it's different from m_iFrameIndex. 更多…
bool _passLastFrame
- Protected 属性 继承自 ProcessBase
float _processScale
缩放进程速度 更多…
bool _isPause
设置和获取动画是否暂停 更多…
bool _isComplete
设置和获取动画是否完成 更多…
bool _isPlaying
设置和获取动画是否正在播放 更多…
float _currentPercent
当前进程到达的百分比 更多…
int _rawDuration
原始长度 更多…
AnimationType _loopType
动画是否循环 更多…
cocos2d::tweenfunc::TweenType _tweenEasing
缓动效果 更多…
float _animationInternal
动画更新速度 更多…
int _durationTween
在动画持续时间内将要播放的帧数 更多…
float _currentFrame
当前进程的当前所处帧,这个帧是中间帧 更多…
int _curFrameIndex
在时间线中的帧的索引 更多…
int _nextFrameIndex
当前进程需要运行到的下一帧 更多…
bool _isLoopBack
- Protected 属性 继承自 Ref
unsigned int _referenceCount
引用计数 更多…

详细描述

NA NA

构造及析构函数说明

Tween ( void )

virtual ~Tween ( void )

virtual

成员函数说明

virtual void arriveKeyFrame ( FrameData * 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.

ArmatureAnimation* getAnimation ( ) const

inline

virtual const MovementBoneData* getMovementBoneData ( ) const

inlinevirtual

virtual void gotoAndPause ( int frameIndex)

virtual

virtual void gotoAndPlay ( int frameIndex)

virtual

virtual bool init ( Bone * bone)

virtual

Init with a Bone.

virtual void play ( MovementBoneData * movementBoneData,
int durationTo,
int durationTween,
int loop,
int tweenEasing
)

virtual

Start the Process.

  • 参数
  • 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

  1. loop < 0 : use the value from MovementData get from Action Editor
  2. loop = 0 : this animation is not loop
  3. loop > 0 : this animation is loop

tweenEasingtween easing is used for calculate easing effect

  1. TWEEN_EASING_MAX : use the value from MovementData get from Action Editor
  2. -1 : fade out
  3. 0 : line
  4. 1 : fade in
  5. 2 : fade in and out

void setAnimation ( ArmatureAnimation * 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.

virtual void setMovementBoneData ( MovementBoneData * data)

inlinevirtual

virtual void tweenColorTo ( float percent,
FrameData * node
)

protectedvirtual

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

virtual FrameData tweenNodeTo ( float percent,
FrameData node = nullptr
)

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.

virtual void updateHandler ( )

protectedvirtual

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

重载 ProcessBase .

类成员变量说明

ArmatureAnimation* _animation

protected

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

FrameData* _between

protected

To frame data, used for calculate between value.

int _betweenDuration

protected

Dedermine which tween effect current frame use.

Bone* _bone

protected

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

TweenType _frameTweenEasing

protected

A weak reference to the Bone.

FrameData* _from

protected

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

int _fromIndex

protected

MovementBoneData* _movementBoneData

protected

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

bool _passLastFrame

protected

FrameData* _to

protected

From frame data, used for calculate between value.

int _toIndex

protected

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

int _totalDuration

protected

Current key frame will last _betweenDuration frames.

FrameData* _tweenData

protected


该类的文档由以下文件生成:

  • /Users/zeroyang/Documents/github/cocos2d-x/cocos/editor-support/cocostudio/CCTween.h
  • cocostudio
  • Tween
  • 生成于 2014年 五月 29日 星期四 09:42:00 , 为 cocos2d-x使用 doxygen 1.8.6