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

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

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

Action类 参考abstract Actions

Action类是所有动作对象的基类. 更多…

#include

类 Action 继承关系图:

Public 成员函数 - 图3 Ref Clonable FiniteTimeAction Follow Speed ActionInstant ActionInterval CallFunc FlipX FlipY Hide Place RemoveSelf ReuseGrid Show StopGrid ToggleVisibility CCBSetSpriteFrame CCBSoundEffect AccelAmplitude AccelDeccelAmplitude ActionCamera ActionEase ActionTween Animate BezierBy Blink CardinalSplineTo DeccelAmplitude DelayTime FadeTo GridAction JumpBy MoveBy ProgressFromTo ProgressTo Repeat RepeatForever ReverseTime RotateBy RotateTo ScaleTo Sequence SkewTo Spawn TargetedAction TintBy TintTo CCBRotateTo CCBRotateXTo CCBRotateYTo

## Public 成员函数
virtual std::string description () const
NA NA 更多…
virtual Action clone () const =0
返回action的克隆对象 更多…
virtual Action reverse () const =0
返回执行与本Action对象相反操作的新Action对象 更多…
virtual bool isDone () const
当action完成时返回true 更多…
virtual void startWithTarget (Node target)
方法在action开始前调用, 操作会设置执行Action的目标对象为target. 更多…
virtual void stop ()
方法在action完成之后调用,它将执行Action的target对象设置为nil. 更多…
virtual void step (float dt)
这个方法每一帧都会被调用, 参数dt为两帧之间的时间间隔(单位秒). 除非你知道正在做什么否则不要重载这个方法. 更多…
virtual void update (float time)
每一帧都会调用这个方法,参数time是一个在0和1之间的值 更多…
Node getTarget () const
void setTarget (Node target)
这个方法更改action的target属性. 更多…
Node getOriginalTarget () const
void setOriginalTarget (Node originalTarget)
设置action的原始目标对象target, 当target为nil时setOriginalTarget设置的对象会运行这个action 除非你要像ActionManager类那样做一些很复杂的操作,否则不要调用这个方法 本方法只是对originalTarget的弱引用(assigned),没有进行retain操作。 更多…
int getTag () const
void setTag (int tag)
- Public 成员函数 继承自 Ref
void retain ()
保留所有权. 更多…
void release ()
立即释放所有权. 更多…
Ref autorelease ()
自动释放所有权在不久的将来. 更多…
unsigned int getReferenceCount () const
返回Ref对象当前的引用计数. 更多…
virtual ~Ref ()
NA NA 更多…
- Public 成员函数 继承自 Clonable
virtual ~Clonable ()
NA NA 更多…
CC_DEPRECATED_ATTRIBUTE Ref * copy () const
返回Ref对象的一份拷贝. 更多…
## 静态 Public 属性
static const int INVALID_TAG = -1
所有Action对象的缺省tag值 更多…
## Protected 成员函数
Action ()
virtual ~Action ()
- Protected 成员函数 继承自 Ref
Ref ()
构造函数 更多…
## Protected 属性
Node _originalTarget
Node _target
action动作的执行目标target. 更多…
int _tag
action的tag属性. 更多…
- Protected 属性 继承自 Ref
unsigned int _referenceCount
引用计数 更多…

详细描述

Action类是所有动作对象的基类.

构造及析构函数说明

Action ( )

protected

virtual ~Action ( )

protectedvirtual

成员函数说明

virtual Action* clone ( ) const

pure virtual

返回action的克隆对象

实现了 Clonable.

TargetedAction, Animate, ReverseTime, DelayTime, EaseCubicActionInOut, EaseCubicActionOut, TintBy, EaseCubicActionIn, TintTo, EaseCircleActionInOut, FadeOut, EaseCircleActionOut, EaseCircleActionIn, FadeIn, EaseQuinticActionInOut, FadeTo, EaseQuinticActionOut, EaseQuinticActionIn, Blink, EaseQuarticActionInOut, ScaleBy, EaseQuarticActionOut, EaseQuarticActionIn, ScaleTo, EaseQuadraticActionInOut, BezierTo, EaseQuadraticActionOut, EaseQuadraticActionIn, BezierBy, EaseBezierAction, EaseBackInOut, JumpTo, EaseBackOut, JumpBy, EaseBackIn, SkewBy, EaseBounceInOut, SkewTo, EaseBounceOut, EaseBounceIn, MoveTo, __CCCallFuncO, EaseBounce, MoveBy, EaseElasticInOut, __CCCallFuncND, EaseElasticOut, RotateBy, CallFuncN, SplitCols, EaseElasticIn, RotateTo, SplitRows, EaseElastic, Twirl, JumpTiles3D, Spawn, CallFunc, EaseSineInOut, ReuseGrid, Waves, EaseSineOut, CatmullRomBy, StopGrid, CCBEaseInstant, WavesTiles3D, CCBRotateYTo, EaseSineIn, CatmullRomTo, Liquid, DeccelAmplitude, Place, CCBRotateXTo, RepeatForever, Follow, TurnOffTiles, EaseExponentialInOut, CardinalSplineBy, CCBRotateTo, Shaky3D, AccelAmplitude, FlipY, EaseExponentialOut, FadeOutDownTiles, CCBSoundEffect, FadeOutUpTiles, Speed, EaseExponentialIn, CardinalSplineTo, Ripple3D, Repeat, CCBSetSpriteFrame, AccelDeccelAmplitude, FlipX, FadeOutBLTiles, EaseInOut, TiledGrid3DAction, RemoveSelf, FiniteTimeAction, FadeOutTRTiles, EaseOut, Lens3D, Sequence, ToggleVisibility, EaseIn, Grid3DAction, FlipY3D, ShuffleTiles, OrbitCamera, Hide, EaseRateAction, FlipX3D, ProgressFromTo, ActionTween, ActionInterval, LuaCallFunc, Show, ShatteredTiles3D, ActionCamera, Waves3D, ActionInstant, PageTurn3D, ActionEase, GridAction, ProgressTo , 以及 ShakyTiles3D 内被实现.

virtual std::string description ( ) const

virtual

NA NA

Node* getOriginalTarget ( ) const

inline

int getTag ( ) const

inline

Node* getTarget ( ) const

inline

virtual bool isDone ( ) const

virtual

当action完成时返回true

RepeatForever, Follow, Speed, Repeat, ActionInterval , 以及 ActionInstant 重载.

virtual Action* reverse ( ) const

pure virtual

返回执行与本Action对象相反操作的新Action对象

TargetedAction, Animate, ReverseTime, DelayTime, EaseCubicActionInOut, EaseCubicActionOut, TintBy, EaseCubicActionIn, TintTo, EaseCircleActionInOut, FadeOut, EaseCircleActionOut, EaseCircleActionIn, FadeIn, EaseQuinticActionInOut, FadeTo, EaseQuinticActionOut, EaseQuinticActionIn, Blink, EaseQuarticActionInOut, ScaleBy, EaseQuarticActionOut, EaseQuarticActionIn, ScaleTo, EaseQuadraticActionInOut, BezierTo, EaseQuadraticActionOut, EaseQuadraticActionIn, BezierBy, EaseBezierAction, EaseBackInOut, JumpTo, EaseBackOut, JumpBy, EaseBackIn, SkewBy, EaseBounceInOut, SkewTo, EaseBounceOut, EaseBounceIn, EaseBounce, MoveBy, EaseElasticInOut, EaseElasticOut, RotateBy, EaseElasticIn, RotateTo, EaseElastic, Spawn, EaseSineInOut, CallFunc, ReuseGrid, EaseSineOut, CatmullRomBy, StopGrid, CCBEaseInstant, CCBRotateYTo, EaseSineIn, CatmullRomTo, DeccelAmplitude, Place, CCBRotateXTo, RepeatForever, Follow, EaseExponentialInOut, CardinalSplineBy, CCBRotateTo, AccelAmplitude, EaseExponentialOut, FlipY, CCBSoundEffect, Speed, EaseExponentialIn, CardinalSplineTo, Repeat, CCBSetSpriteFrame, AccelDeccelAmplitude, FlipX, EaseInOut, RemoveSelf, FiniteTimeAction, EaseOut, Sequence, ToggleVisibility, EaseIn, Hide, EaseRateAction, ProgressFromTo, ActionTween, ActionInterval, Show, ActionCamera, ActionInstant, ActionEase, GridAction , 以及 ProgressTo 内被实现.

void setOriginalTarget ( Node * originalTarget)

inline

设置action的原始目标对象target, 当target为nil时setOriginalTarget设置的对象会运行这个action 除非你要像ActionManager类那样做一些很复杂的操作,否则不要调用这个方法 本方法只是对originalTarget的弱引用(assigned),没有进行retain操作。

  • 自从
  • v0.8.2

void setTag ( int tag)

inline

void setTarget ( Node * target)

inline

这个方法更改action的target属性.

virtual void startWithTarget ( Node * target)

virtual

方法在action开始前调用, 操作会设置执行Action的目标对象为target.

TargetedAction, Animate, ReverseTime, TintBy, TintTo, FadeOut, FadeIn, FadeTo, Blink, ScaleBy, ScaleTo, BezierTo, BezierBy, JumpTo, JumpBy, SkewBy, SkewTo, MoveTo, MoveBy, RotateBy, SplitCols, RotateTo, SplitRows, Spawn, ReuseGrid, StopGrid, CCBRotateYTo, DeccelAmplitude, RepeatForever, CCBRotateXTo, TurnOffTiles, CCBRotateTo, CardinalSplineBy, AccelAmplitude, Speed, CardinalSplineTo, Repeat, AccelDeccelAmplitude, Sequence, OrbitCamera, ShuffleTiles, ProgressFromTo, ActionTween, ActionInterval, ActionCamera, ActionEase, GridAction , 以及 ProgressTo 重载.

virtual void step ( float dt)

virtual

这个方法每一帧都会被调用, 参数dt为两帧之间的时间间隔(单位秒). 除非你知道正在做什么否则不要重载这个方法.

RepeatForever, Follow, Speed, ActionInterval , 以及 ActionInstant 重载.

virtual void stop ( )

virtual

方法在action完成之后调用,它将执行Action的target对象设置为nil.

IMPORTANT: 你不应该直接去调用 "action->stop()" 方法, 而应该调用 "target->stopAction(action);"

TargetedAction, Animate, ReverseTime, Blink, Spawn, Follow, Speed, Repeat, Sequence , 以及 ActionEase 重载.

virtual void update ( float time)

virtual

每一帧都会调用这个方法,参数time是一个在0和1之间的值

time的含义举例:

  • 0 表示action刚刚开始
  • 0.5 表示action执行到正中间
  • 1 表示action已经执行完毕

TargetedAction, Animate, ReverseTime, DelayTime, EaseCubicActionInOut, EaseCubicActionOut, TintBy, EaseCubicActionIn, TintTo, EaseCircleActionInOut, EaseCircleActionOut, EaseCircleActionIn, EaseQuinticActionInOut, FadeTo, EaseQuinticActionOut, Blink, EaseQuinticActionIn, EaseQuarticActionInOut, EaseQuarticActionOut, EaseQuarticActionIn, ScaleTo, EaseQuadraticActionInOut, EaseQuadraticActionOut, EaseQuadraticActionIn, BezierBy, EaseBezierAction, EaseBackInOut, EaseBackOut, JumpBy, EaseBackIn, EaseBounceInOut, SkewTo, EaseBounceOut, EaseBounceIn, MoveBy, EaseElasticInOut, EaseElasticOut, RotateBy, SplitCols, EaseElasticIn, RotateTo, SplitRows, Twirl, JumpTiles3D, Spawn, EaseSineInOut, CallFunc, Waves, EaseSineOut, CCBEaseInstant, WavesTiles3D, CCBRotateYTo, EaseSineIn, Liquid, DeccelAmplitude, CCBRotateXTo, Place, TurnOffTiles, EaseExponentialInOut, CCBRotateTo, Shaky3D, AccelAmplitude, EaseExponentialOut, FlipY, CCBSoundEffect, CardinalSplineTo, Repeat, EaseExponentialIn, Ripple3D, CCBSetSpriteFrame, AccelDeccelAmplitude, FlipX, EaseInOut, RemoveSelf, FadeOutTRTiles, Lens3D, EaseOut, Sequence, ToggleVisibility, EaseIn, FlipY3D, OrbitCamera, ShuffleTiles, Hide, ProgressFromTo, FlipX3D, ActionTween, Show, ShatteredTiles3D, Waves3D, ActionInstant, ActionEase, PageTurn3D, ProgressTo , 以及 ShakyTiles3D 重载.

类成员变量说明

Node* _originalTarget

protected

int _tag

protected

action的tag属性.

是action的一个标识

Node* _target

protected

action动作的执行目标target.

在 'startWithTarget' 方法中会对target进行设置. 当 'stop' 方法被调用时, target会被设置为nil. target 是弱引用(assigned),没有进行retain操作.

const int INVALID_TAG = -1

static

所有Action对象的缺省tag值


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

  • /Users/zeroyang/Documents/github/cocos2d-x/cocos/2d/CCAction.h
  • cocos2d
  • Action
  • 生成于 2014年 五月 29日 星期四 09:41:43 , 为 cocos2d-x使用 doxygen 1.8.6