cocos2d - X 노드 (CCTween. h) API

본문http://blog.csdn.net/runaying ,인용 은 출처 를 밝 혀 야 합 니 다!
cocos2d - X 노드 (CCTween. h) API
따뜻 한 알림: 여러분 이 더 잘 공부 할 수 있 도록 본인 의 블 로 그 를 보 는 것 을 강력 추천 합 니 다. Cocos2d - X 권위 있 는 안내서 노트
추가 애니메이션
///cocos2d-x-3.0alpha0/extensions/CocoStudio/Armature/animation
//    


#ifndef __CCTWEEN_H__
#define __CCTWEEN_H__

#include "CCProcessBase.h"
#include "../utils/CCTweenFunction.h"

NS_CC_EXT_ARMATURE_BEGIN

class Bone;
class ArmatureAnimation;

class  Tween : public ProcessBase
{
public:
    /**
     * Create with a Bone
     * @param bone the Bone Tween will bind to              //  bone      Bone Tween
     */
    static Tween *create(Bone *bone);
public:
	/**
     * @js ctor
     */
    Tween(void);
    /**
     * @js NA
     * @lua NA
     */
    virtual ~Tween(void);

    /**
     * Init with a Bone
     * @param bone the Bone Tween will bind to
     */
    virtual bool init(Bone *bone);

    /**
     *     
     *
     * @param  movementBoneData  the MovementBoneData        FrameData
     * @param  durationTo         	     
     * @param  durationTween               。
     *          _durationTween 80,             80 
     *
     * @param  loop   w      
     *
     *         loop < 0 : MovementData        action        
     *         loop = 0 : this animation is not loop
     *         loop > 0 : this animation is loop
     *
     * @param  tweenEasing    Tween easing          
     *
     *         TWEEN_EASING_MAX : MovementData        action        
     *         -1 : fade out          
     *         0  : line
     *         1  : fade in               
     *         2  : fade in and out      
     *
     */
    virtual void play(MovementBoneData *movementBoneData, int durationTo, int durationTween,  int loop, int tweenEasing);

    inline void setAnimation(ArmatureAnimation *animation)
    {
        _animation = animation;
    }
    inline ArmatureAnimation *getAnimation() const
    {
        return _animation;
    }
protected:

    /**
     * Update(float dt)         ,            
     */
    virtual void updateHandler();

    /**
     *          ,          ,        
     */
    virtual float updateFrameData(float currentPercent);

    /**
     *   _from _TO     ,        
     */
    virtual void setBetween(FrameData *from, FrameData *to, bool limit = true);

    /**
     *           FrameData     
     */
    virtual FrameData *tweenNodeTo(float percent, FrameData *node = NULL);

    /**
     *                   
     */
    virtual void tweenColorTo(float percent, FrameData *node);

    /**
     *       ,                
     */
    virtual void arriveKeyFrame(FrameData *keyFrameData);
protected:
    //!       MovementBoneData。        
    CC_SYNTHESIZE(MovementBoneData *, _movementBoneData, MovementBoneData)

    FrameData *_tweenData;		//!          , //! the Bone's tweenData     
    FrameData *_from;				//! From    ,        
    FrameData *_to;				//! To frame    ,        
    FrameData *_between;			//! Between    ,         FrameData(m_pNode)   


    Bone *_bone;					//!    Bone     

    CCTweenType _frameTweenEasing;	//!               

    int _betweenDuration;			//!         _betweenDuration 
    int _totalDuration;


    int _fromIndex;				//! MovementBoneData            ,    m_iFrameIndex   
    int _toIndex;					//! MovementBoneData            ,    m_iFrameIndex   

    ArmatureAnimation *_animation;

};

NS_CC_EXT_ARMATURE_END

#endif /*__CCTWEEN_H__*/

좋은 웹페이지 즐겨찾기