2011-06-14 14:31:25 +08:00
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
class CCMenuItem : public CCNodeRGBA
|
2012-02-02 14:26:38 +08:00
|
|
|
{
|
|
|
|
CCRect rect();
|
|
|
|
void activate();
|
|
|
|
void selected();
|
|
|
|
void unselected();
|
2012-06-15 17:26:11 +08:00
|
|
|
void setEnabled(bool enabled);
|
2013-07-04 12:50:17 +08:00
|
|
|
bool isEnabled() const;
|
|
|
|
bool isSelected() const;
|
2012-02-02 14:26:38 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class CCMenuItemLabel : public CCMenuItem
|
|
|
|
{
|
|
|
|
void setString(const char* label);
|
|
|
|
|
|
|
|
void setOpacity(GLubyte opacity);
|
|
|
|
GLubyte getOpacity();
|
2013-07-08 11:34:31 +08:00
|
|
|
void setColor(Color3B color);
|
|
|
|
Color3B getColor();
|
|
|
|
void setDisabledColor(const Color3B & color);
|
|
|
|
const Color3B & getDisabledColor();
|
2012-08-10 18:14:04 +08:00
|
|
|
void setLabel(CCNode* pLabel);
|
|
|
|
CCNode* getLabel();
|
|
|
|
|
|
|
|
void activate();
|
|
|
|
void selected();
|
|
|
|
void unselected();
|
|
|
|
void setEnabled(bool enabled);
|
|
|
|
|
|
|
|
void setOpacityModifyRGB(bool bValue);
|
|
|
|
bool isOpacityModifyRGB(void);
|
2012-02-02 14:26:38 +08:00
|
|
|
|
2012-06-15 11:46:51 +08:00
|
|
|
static CCMenuItemLabel* create(CCNode* label);
|
2012-02-02 14:26:38 +08:00
|
|
|
};
|
|
|
|
|
2012-08-27 11:43:47 +08:00
|
|
|
class CCMenuItemAtlasFont : public CCMenuItemLabel
|
2012-02-02 14:26:38 +08:00
|
|
|
{
|
2012-06-15 11:46:51 +08:00
|
|
|
static CCMenuItemAtlasFont* create(const char* value,
|
2012-02-02 14:26:38 +08:00
|
|
|
const char* charMapFile,
|
|
|
|
int itemWidth,
|
|
|
|
int itemHeight,
|
|
|
|
char startCharMap);
|
|
|
|
};
|
|
|
|
|
2012-08-27 11:43:47 +08:00
|
|
|
class CCMenuItemFont : public CCMenuItemLabel
|
2012-02-02 14:26:38 +08:00
|
|
|
{
|
|
|
|
static void setFontSize(int s);
|
2013-07-22 13:42:58 +08:00
|
|
|
static unsigned int getFontSize();
|
2012-02-02 14:26:38 +08:00
|
|
|
static void setFontName(const char* name);
|
2013-07-22 13:42:58 +08:00
|
|
|
static const char* getFontName();
|
2012-08-10 18:14:04 +08:00
|
|
|
void setFontSizeObj(unsigned int s);
|
2013-07-22 13:42:58 +08:00
|
|
|
unsigned int getFontSizeObj();
|
2012-08-10 18:14:04 +08:00
|
|
|
void setFontNameObj(const char* name);
|
2013-07-22 13:42:58 +08:00
|
|
|
const char* getFontNameObj() const;
|
2012-08-10 18:14:04 +08:00
|
|
|
|
2012-06-15 11:46:51 +08:00
|
|
|
static CCMenuItemFont * create(const char* value);
|
2012-02-02 14:26:38 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class CCMenuItemSprite : public CCMenuItem
|
|
|
|
{
|
2013-07-08 11:34:31 +08:00
|
|
|
void setColor(Color3B color);
|
|
|
|
Color3B getColor();
|
2012-02-02 14:26:38 +08:00
|
|
|
void setOpacity(GLubyte opacity);
|
|
|
|
GLubyte getOpacity();
|
|
|
|
|
2012-08-10 18:14:04 +08:00
|
|
|
void setNormalImage(CCNode* pImage);
|
|
|
|
CCNode* getNormalImage();
|
|
|
|
void setSelectedImage(CCNode* pImage);
|
|
|
|
CCNode* getSelectedImage();
|
|
|
|
void setDisabledImage(CCNode* pImage);
|
|
|
|
CCNode* getDisabledImage();
|
|
|
|
|
|
|
|
void selected();
|
|
|
|
void unselected();
|
|
|
|
void setEnabled(bool bEnabled);
|
|
|
|
|
|
|
|
void setOpacityModifyRGB(bool bValue);
|
|
|
|
bool isOpacityModifyRGB(void);
|
|
|
|
|
2012-06-15 11:46:51 +08:00
|
|
|
static CCMenuItemSprite * create(CCNode* normalSprite,
|
2012-02-02 14:26:38 +08:00
|
|
|
CCNode* selectedSprite,
|
|
|
|
CCNode* disabledSprite);
|
2012-09-17 14:40:42 +08:00
|
|
|
static CCMenuItemSprite * create(CCNode* normalSprite,
|
|
|
|
CCNode* selectedSprite);
|
2012-02-02 14:26:38 +08:00
|
|
|
};
|
|
|
|
|
2012-08-27 11:43:47 +08:00
|
|
|
class CCMenuItemImage : public CCMenuItemSprite
|
2012-02-02 14:26:38 +08:00
|
|
|
{
|
2013-07-08 11:34:31 +08:00
|
|
|
void setColor(Color3B color);
|
|
|
|
Color3B getColor();
|
2012-02-02 14:26:38 +08:00
|
|
|
void setOpacity(GLubyte opacity);
|
|
|
|
GLubyte getOpacity();
|
|
|
|
|
2012-08-10 18:14:04 +08:00
|
|
|
void setNormalSpriteFrame(CCSpriteFrame* frame);
|
|
|
|
void setSelectedSpriteFrame(CCSpriteFrame* frame);
|
|
|
|
void setDisabledSpriteFrame(CCSpriteFrame* frame);
|
|
|
|
|
2012-06-15 11:46:51 +08:00
|
|
|
static CCMenuItemImage* create(const char* normalImage,
|
2012-02-02 14:26:38 +08:00
|
|
|
const char* selectedImage,
|
|
|
|
const char* disabledImage);
|
2012-09-17 14:40:42 +08:00
|
|
|
static CCMenuItemImage* create(const char* normalImage,
|
|
|
|
const char* selectedImage);
|
|
|
|
static CCMenuItemImage* create();
|
2012-02-02 14:26:38 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class CCMenuItemToggle : public CCMenuItem
|
|
|
|
{
|
2013-07-08 11:34:31 +08:00
|
|
|
void setColor(Color3B color);
|
|
|
|
Color3B getColor();
|
2012-08-10 18:14:04 +08:00
|
|
|
void setOpacity(GLubyte opacity);
|
|
|
|
GLubyte getOpacity();
|
2013-04-03 16:29:16 +08:00
|
|
|
void setSelectedIndex(unsigned int index);
|
|
|
|
unsigned int getSelectedIndex();
|
|
|
|
void setSubItems(CCArray* pArrayOfItems);
|
|
|
|
CCArray* getSubItems();
|
2012-08-10 18:14:04 +08:00
|
|
|
|
2013-04-03 16:29:16 +08:00
|
|
|
void addSubItem(CCMenuItem *item);
|
2013-07-22 13:42:58 +08:00
|
|
|
CCMenuItem* getSelectedItem();
|
2012-02-02 14:26:38 +08:00
|
|
|
|
2013-04-03 16:29:16 +08:00
|
|
|
void activate();
|
2012-08-10 18:14:04 +08:00
|
|
|
void selected();
|
|
|
|
void unselected();
|
|
|
|
void setEnabled(bool var);
|
|
|
|
|
|
|
|
void setOpacityModifyRGB(bool bValue);
|
|
|
|
bool isOpacityModifyRGB(void);
|
|
|
|
|
2012-06-15 11:46:51 +08:00
|
|
|
static CCMenuItemToggle* create(CCMenuItem *item);
|
2012-02-02 14:26:38 +08:00
|
|
|
};
|