#ifndef __XSprite_H__ #define __XSprite_H__ #include "CocoHead.h" #define BTN_FRAME_AMOUNT 3 class ENGINE_API CXSprite : public CCSprite { public: /* 按钮的图片分割成几张 那个分割后每张的索引值 */ enum BTN_FRAME_INDEX { BTN_FRAME_0 = 0, BTN_FRAME_1 = 1, BTN_FRAME_2 = 2, BTN_FRAME_3 = 3, BTN_FRAME_4 = 4, }; CXSprite(); virtual ~CXSprite(); //通过文件直接创建Sprite static CXSprite* createSprite(const char* psFile, int nFrameIndex = -1); //通过预先加载的CCSpriteFrame来创建Sprite //nFrameIndex : -1--普通图片 0-2--按钮图片帧(按钮统一为3帧) static CXSprite* create(const char* psTag, int nFrameIndex = -1); string getPicName(); public: string m_strPic; }; #endif //__XSprite_H__