CCAction动作基类关系

class CC_DLL CCAction : public CCObject
{
public:
CCAction(void);
virtual ~CCAction(void); const char* description(); virtual CCObject* copyWithZone(CCZone *pZone); //! return true if the action has finished
virtual bool isDone(void); //! called before the action start. It will also set the target.
virtual void startWithTarget(CCNode *pTarget); /**
called after the action has finished. It will set the 'target' to nil.
IMPORTANT: You should never call "[action stop]" manually. Instead, use: "target->stopAction(action);"
*/
virtual void stop(void); //! called every frame with it's delta time. DON'T override unless you know what you are doing.
virtual void step(float dt); /**
called once per frame. time a value between 0 and 1 For example:
- 0 means that the action just started
- 0.5 means that the action is in the middle
- 1 means that the action is over
*/
virtual void update(float time); inline CCNode* getTarget(void) { return m_pTarget; }
/** The action will modify the target properties. */
inline void setTarget(CCNode *pTarget) { m_pTarget = pTarget; } inline CCNode* getOriginalTarget(void) { return m_pOriginalTarget; }
/** Set the original target, since target can be nil.
Is the target that were used to run the action. Unless you are doing something complex, like CCActionManager, you should NOT call this method.
The target is 'assigned', it is not 'retained'.
@since v0.8.2
*/
inline void setOriginalTarget(CCNode *pOriginalTarget) { m_pOriginalTarget = pOriginalTarget; } inline int getTag(void) { return m_nTag; }
inline void setTag(int nTag) { m_nTag = nTag; } public:
/** Create an action */
static CCAction* create();
protected:
CCNode *m_pOriginalTarget;
/** The "target".
The target will be set with the 'startWithTarget' method.
When the 'stop' method is called, target will be set to nil.
The target is 'assigned', it is not 'retained'.
*/
CCNode *m_pTarget;
/** The action tag. An identifier of the action */
int m_nTag;
};

            即时动作的具体类

            持续动作类的结构图

动作基类 CCAction的更多相关文章

  1. 【Cocos2d-X开发学习笔记】第12期:动作类CCAction的详细讲解

    一般对于游戏中的精灵而言,它们不仅仅是存在于场景中,而且是动态展现的,例如,精灵移动的动态效果.动 画效果.跳动效果.闪烁和旋转动态效果等.每一种效果都可以看成是精灵的一个动作. 一.动作类(CCAc ...

  2. C++ - 虚基类、虚函数与纯虚函数

    虚基类       在说明其作用前先看一段代码 class A{public:    int iValue;}; class B:public A{public:    void bPrintf(){ ...

  3. django中抽象基类的Foreignkey的定义

    class base(models.Model): user = models.ForeignKey(User) class Meta: abstract =True 以上是抽象基类的定义,只有一个公 ...

  4. (转) C++中基类和派生类之间的同名函数的重载问题

    下面有关派生类与基类中存在同名函数 fn: class A { public: void fn() {} void fn(int a) {} }; class B : public A { publi ...

  5. cocos2d-x 的两大基类

    cocos2d-x 有两个重要的基类,一个管理引用计数的 Ref,别一个则定义许多基本属性的 Node. 在 cocos2d-x 中的基本概念 说到 create 函数的时候提到 cocos2d-x ...

  6. javascript组件开发之基类继承实现

    上一篇文章大概的介绍了一下关于javascript组件的开发方式,这篇文章主要详细记一下基类的编写,这个基类主要是实现继承的功能 为什么要封装基类? 由于这次重构项目需要对各种组件进行封装,并且这些组 ...

  7. effective c++(07)之为多态基类声明virtual析构函数

    class TimeKeeper { public: TimeKeeper() ; ~TimeKepper() ; ... } ; class AtomicClock:public TimeKeepe ...

  8. 《Programming WPF》翻译 第9章 2.选择一个基类

    原文:<Programming WPF>翻译 第9章 2.选择一个基类 WPF提供了很多类,当创建一个自定义元素时,你可以从这些类中派生.图9-1显示了一组可能作为类--可能是合适的基类, ...

  9. Effective C++_笔记_条款07_为多态基类声明virtual析构函数

    (整理自Effctive C++,转载请注明.整理者:华科小涛@http://www.cnblogs.com/hust-ghtao/) 这个规则只适用于polymorphic(带多态性质的)base ...

随机推荐

  1. 由浅到深理解ROS(3)-命名空间

    全局命名空间: /rosout前面的反斜杠“/”表明该节点名称属于全局命名空间.之所以叫做全局名称因为它们在任何地方(包括代码.命令行工具.图形界面工具等的任何地方)都可以使用.无论这些名称用作众多命 ...

  2. python基础: day4作业计算器

    作业:计算器开发 实现加减乘除及拓号优先级解析 用户输入 1 - 2 * ( (60-30 +(-40/5) * (9-2*5/3 + 7 /3*99/4*2998 +10 * 568/14 )) - ...

  3. python在windows下安装paramiko模块和安装pycrypto模块(3步搞定)(转)

    Python中使用SSH需要用到OpenSSH,而OpenSSH依赖于paramiko模块,而paramiko模块又依赖于pycrypto模块,因此要在Python中使用SSH,我们需要先安装pycr ...

  4. Linux改动hostname的两个办法

    假设你想把主机名改为 linux的话.两中方法: 1. # hostname linux 这样改动了以后马上生效.可是重新启动后就没了 2. # vi /etc/sysconfig/network 改 ...

  5. Function- 几个转换函数

    几个转换函数 SJIS_DBC_TO_SBC 全角转半角SJIS_SBC_TO_DBC 半角转全角 CLPB_IMPORT :从剪贴板导入internal tableCLPB_EXPORT : 从in ...

  6. python基础13 ---函数模块3(正则表达式)

    正则表达式 一.正则表达式的本质 1.正则表达式的本质(或 RE)是一种小型的.高度专业化的编程语言,(在Python中)它内嵌在Python中,并通过 re 模块实现.正则表达式模式被编译成一系列的 ...

  7. linux shell 字符串操作(长度,查找,替换)

    感谢原创,文章很有帮助. 转自:http://www.cnblogs.com/chengmo/archive/2010/10/02/1841355.html 一.判断读取字符串值 表达式 含义 ${v ...

  8. 关于Unicode转为str的方法

    unicode_a=u'\u810f\u4e71' str_a=unicode_a.encode('unicode-escape').decode('string_escape')

  9. 2django 视图与网址进阶

    一.在网页中做加减法 采用/add/?a=11&b=22这样get方法进行 django-admin.py startproject zqxt_views cd zqxt_views pyth ...

  10. persisted? vs new_record?

    https://joe11051105.gitbooks.io/you-need-to-know-about-ruby-on-rails/content/activerecord/persisted_ ...