2011-06-14 14:31:25 +08:00
|
|
|
|
2012-02-02 14:26:38 +08:00
|
|
|
class CCMenuItem : public CCNode
|
|
|
|
{
|
|
|
|
CCRect rect();
|
|
|
|
void activate();
|
|
|
|
void selected();
|
|
|
|
void unselected();
|
|
|
|
void setIsEnabled(bool enabled);
|
|
|
|
bool getIsEnabled();
|
|
|
|
bool getIsSelected();
|
|
|
|
|
|
|
|
tolua_property__CCIsEnabled bool isEnabled;
|
|
|
|
|
|
|
|
void registerScriptHandler(LUA_FUNCTION funcID);
|
2012-02-02 15:58:10 +08:00
|
|
|
void unregisterScriptHandler(void);
|
2012-02-02 14:26:38 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class CCMenuItemLabel : public CCMenuItem
|
|
|
|
{
|
|
|
|
void setString(const char* label);
|
|
|
|
|
|
|
|
void setOpacity(GLubyte opacity);
|
|
|
|
GLubyte getOpacity();
|
|
|
|
void setColor(ccColor3B color);
|
|
|
|
ccColor3B getColor();
|
|
|
|
|
|
|
|
static CCMenuItemLabel* itemWithLabel(CCNode* label);
|
|
|
|
};
|
|
|
|
|
|
|
|
class CCMenuItemAtlasFont : public CCMenuItem
|
|
|
|
{
|
2012-04-09 00:10:12 +08:00
|
|
|
static CCMenuItemAtlasFont* itemWithString(const char* value,
|
2012-02-02 14:26:38 +08:00
|
|
|
const char* charMapFile,
|
|
|
|
int itemWidth,
|
|
|
|
int itemHeight,
|
|
|
|
char startCharMap);
|
|
|
|
};
|
|
|
|
|
|
|
|
class CCMenuItemFont : public CCMenuItem
|
|
|
|
{
|
|
|
|
static void setFontSize(int s);
|
|
|
|
static int fontSize();
|
|
|
|
static void setFontName(const char* name);
|
|
|
|
static const char* fontName();
|
2012-04-09 00:10:12 +08:00
|
|
|
static CCMenuItemFont * itemWithString(const char* value);
|
2012-02-02 14:26:38 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class CCMenuItemSprite : public CCMenuItem
|
|
|
|
{
|
|
|
|
void setColor(ccColor3B color);
|
|
|
|
ccColor3B getColor();
|
|
|
|
void setOpacity(GLubyte opacity);
|
|
|
|
GLubyte getOpacity();
|
|
|
|
|
2012-04-09 00:10:12 +08:00
|
|
|
static CCMenuItemSprite * itemWithNormalSprite(CCNode* normalSprite,
|
2012-02-02 14:26:38 +08:00
|
|
|
CCNode* selectedSprite);
|
2012-04-09 00:10:12 +08:00
|
|
|
static CCMenuItemSprite * itemWithNormalSprite(CCNode* normalSprite,
|
2012-02-02 14:26:38 +08:00
|
|
|
CCNode* selectedSprite,
|
|
|
|
CCNode* disabledSprite);
|
|
|
|
};
|
|
|
|
|
|
|
|
class CCMenuItemImage : public CCMenuItem
|
|
|
|
{
|
|
|
|
void setColor(ccColor3B color);
|
|
|
|
ccColor3B getColor();
|
|
|
|
void setOpacity(GLubyte opacity);
|
|
|
|
GLubyte getOpacity();
|
|
|
|
|
2012-04-09 00:10:12 +08:00
|
|
|
static CCMenuItemImage* itemWithNormalImage(const char* normalImage,
|
2012-02-02 14:26:38 +08:00
|
|
|
const char* selectedImage);
|
2012-04-09 00:10:12 +08:00
|
|
|
static CCMenuItemImage* itemWithNormalImage(const char* normalImage,
|
2012-02-02 14:26:38 +08:00
|
|
|
const char* selectedImage,
|
|
|
|
const char* disabledImage);
|
|
|
|
};
|
|
|
|
|
|
|
|
class CCMenuItemToggle : public CCMenuItem
|
|
|
|
{
|
|
|
|
void addSubItem(CCMenuItem *item);
|
|
|
|
CCMenuItem* selectedItem();
|
|
|
|
|
|
|
|
static CCMenuItemToggle* itemWithItem(CCMenuItem *item);
|
|
|
|
};
|