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. python tensorflow 安装

    我是先下载tensorflow-1.5.0rc1-cp36-cp36m-win32.whl,再执行命令行安装的 下载地址:https://pypi.python.org/pypi/tensorflow ...

  2. 自定义circleindicator

    在此申明,并不是自己写的,只是为了方便日后使用 我使用的circleindicator是从大神的gitHub中弄来的, 使用如下: 一.在配置中导入 compile 'me.relex:circlei ...

  3. 论JavaWeb前后端分离放弃jsp

    1.静态资源使用Nginx反向代理Tomcat,Tomcat挂了网站仍可访问.2.静态与后端服务器分离,提升性能.3.大并发情况下,可同时扩展前后端服务器.4.接口可复用至App相关服务.5.网站热部 ...

  4. web 文件下载

    response.reset(); response.setContentType("octets/stream"); response.addHeader("Conte ...

  5. 我的Android进阶之旅------>Android中的布局优化 include、merge 、ViewStub

    1.如何重用布局文件? 可以使用<include>标签引用其他的布局文件,并用android:id属性覆盖被引用布局文件中顶层节点的android:id属性值.代码如下: <!--引 ...

  6. Java语言实现简单FTP软件------>远程文件管理模块的实现(十)

    首先看一下界面: 1.远程FTP服务器端的文件列表的显示 将远程的当前目录下所有文件显示出来,并显示文件的属性包括文件名.大小.日期.通过javax.swing.JTable()来显示具体的数据.更改 ...

  7. ABAP xml

    [转]Part 1 - Expressiveness of Simple TransformationsSimple Transformations are a SAP proprietary pro ...

  8. (转)RequireJS shim 用法说明

    RequireJS中如果使用AMD规范,在使用的过程中没有太多的问题,如果加载非AMD规范的JS文件,就需要使用Require中的shim. require.config({ paths:{ jque ...

  9. 云计算服务的三种类型(SaaS、PaaS、IaaS)

    云计算可以帮助企业降低IT方面的成本和复杂性,并获得他们蓬勃发展所需的灵活性与敏捷性.但是,规划出通往云的明确路径并非易事.毕竟用户需要看透与云相关的市场大肆宣传,然后理解并分析不同种类的云计算模式的 ...

  10. R中常用数据挖掘算法包

    数据挖掘主要分为4类,即预测.分类.聚类和关联,根据不同的挖掘目的选择相应的算法.下面对R语言中常用的数据挖掘包做一个汇总: 连续因变量的预测: stats包 lm函数,实现多元线性回归 stats包 ...