Cocos2d-x结构学习(十四)CCEaseExponential、CCEaseSine、CCRepeatForever、CCCA

前端之家收集整理的这篇文章主要介绍了Cocos2d-x结构学习(十四)CCEaseExponential、CCEaseSine、CCRepeatForever、CCCA前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1、CCEaseExponentialIn:指数级,继承自CCActionEase

class CC_DLL CCEaseExponentialIn : public CCActionEase
{
public:
    virtual void update(float time);
    virtual CCActionInterval* reverse(void);
    virtual CCObject* copyWithZone(CCZone* pZone);
public:
    static CCEaseExponentialIn* create(CCActionInterval* pAction);
};
2、CCEaseExponentialOut:指数级,继承自CCActionEase
class CC_DLL CCEaseExponentialOut : public CCActionEase
{
public:
    virtual void update(float time);
    virtual CCActionInterval* reverse(void);
    virtual CCObject* copyWithZone(CCZone* pZone);
public:
    static CCEaseExponentialOut* create(CCActionInterval* pAction);
};
3、CCEaseSineIn:正弦,继承自CCActionEase
class CC_DLL CCEaseSineIn : public CCActionEase
{
public:
    virtual void update(float time);
    virtual CCActionInterval* reverse(void);
    virtual CCObject* copyWithZone(CCZone* pZone);

public:
    static CCEaseSineIn* create(CCActionInterval* pAction);
};
4、CCEaseSineOut:正弦,继承自CCActionEase
class CC_DLL CCEaseSineOut : public CCActionEase
{
public:
    virtual void update(float time);
    virtual CCActionInterval* reverse(void);
    virtual CCObject* copyWithZone(CCZone* pZone);
public:
    static CCEaseSineOut* create(CCActionInterval* pAction);
};
5、CCRepeatForever:永久重复,继承自CCActionInterval
class CC_DLL CCRepeatForever : public CCActionInterval
{
public:
    CCRepeatForever()
        : m_pInnerAction(NULL)
    {}
    virtual ~CCRepeatForever();

    bool initWithAction(CCActionInterval *pAction);
 
    virtual CCObject* copyWithZone(CCZone *pZone);
    virtual void startWithTarget(CCNode* pTarget);
    virtual void step(float dt);
    virtual bool isDone(void);
    virtual CCActionInterval* reverse(void);

    inline void setInnerAction(CCActionInterval *pAction)
    {
        if (m_pInnerAction != pAction)
        {
            CC_SAFE_RELEASE(m_pInnerAction);
            m_pInnerAction = pAction;
            CC_SAFE_RETAIN(m_pInnerAction);
        }
    }

    inline CCActionInterval* getInnerAction()
    {
        return m_pInnerAction;
    }

public:
    static CCRepeatForever* create(CCActionInterval *pAction);
protected:
    CCActionInterval *m_pInnerAction;
};
6、CCCA:简化操作的宏
#define CCCA(x)   (x->copy()->autorelease())
原文链接:https://www.f2er.com/cocos2dx/343765.html

猜你在找的Cocos2d-x相关文章