cocos2d - X 노드 (CCActionObject. h) API

본문http://blog.csdn.net/runaying ,인용 은 출처 를 밝 혀 야 합 니 다!
cocos2d - X 노드 (CCActionObject. h) API
따뜻 한 알림: 여러분 이 더 잘 공부 할 수 있 도록 본인 의 블 로 그 를 보 는 것 을 강력 추천 합 니 다. Cocos2d - X 권위 있 는 안내서 노트
 대상 이름, 프레임 의 시간 간격, 재생 / 정지 / 일시 정지, 액 션 노드 를 재생 액 션 으로 추가 / 제거 합 니 다.
///cocos2d-x-3.0alpha0/extensions/CocoStudio/Action
//      ,      ,  /  /      action,  /      ActionNode      action.


#ifndef __ActionObject_H__
#define __ActionObject_H__

#include "cocos2d.h"
#include "ExtensionMacros.h"
#include "CCActionNode.h"
#include "../Json/CSContentJsonDictionary.h"

NS_CC_EXT_BEGIN

class ActionObject:public Object
{
public:
    
    /**
     * Default constructor      //    
     */
    ActionObject();
    
    /**
     * Default destructor       //    
     */
    virtual ~ActionObject();
    
    /**
     * Sets      
     *
     * @param name       
     */
	void setName(const char* name);
	const char* getName();
    
    /**
     * Sets action       
     *
	 * @param bLoop  action       
     */
	void setLoop(bool bLoop);
	bool getLoop();
    
    /**
     * Sets       。
     *
	 * @param fTime         。
     */
	void setUnitTime(float fTime);
	float getUnitTime();

    /**
     * Sets        
     *
	 * @param fTime        
     */
    void setCurrentTime(float fTime);
	float getCurrentTime();
	
    /**
     * Return action      .
     *
	 * @return true    action     , false the otherwise
     */
	bool isPlaying();

    /**
     *    action.
     */
	void play();

    /**
     * Pause the action.
     */
	void pause();
    
    /**
     * Stop the action.
     */
	void stop();

    /**
     *      ActionNode      action.
     *
	 * @node    the ActionNode which will play the action
     */
	void addActionNode(ActionNode* node);
    
    /**
     * Removes a ActionNode which play the action.
     *
	 * @node    the ActionNode which play the action
     */
	void removeActionNode(ActionNode* node);

    /*update frame method*/
	void updateToFrameByTime(float fTime);

    /*    json         */
    void initWithDictionary(cs::JsonDictionary* dic,Object* root);
    
protected:
	Array* _actionNodeList;/*actionnode*/
	std::string _name;
	bool _loop;
	bool _bPause;
	bool _bPlaying;
	float _fUnitTime;
	float _currentTime;
};

NS_CC_EXT_END

#endif

좋은 웹페이지 즐겨찾기