2011-06-14 14:31:25 +08:00
|
|
|
|
2011-11-09 23:23:47 +08:00
|
|
|
class CCMenuItem : public CCNode
|
|
|
|
{
|
|
|
|
CCRect rect();
|
|
|
|
void activate();
|
|
|
|
void selected();
|
|
|
|
void unselected();
|
|
|
|
|
|
|
|
void registerScriptHandler(const char* pszFunctionName);
|
|
|
|
static CCMenuItem * itemWithTarget(SelectorProtocol *rec, SEL_MenuHandler selector);
|
|
|
|
};
|
|
|
|
|
|
|
|
class CCMenuItemLabel : public CCMenuItem
|
|
|
|
{
|
|
|
|
void setString(const char * label);
|
|
|
|
void setIsEnabled(bool enabled);
|
|
|
|
|
|
|
|
void setOpacity(GLubyte opacity);
|
|
|
|
GLubyte getOpacity();
|
|
|
|
void setColor(ccColor3B color);
|
|
|
|
ccColor3B getColor();
|
|
|
|
|
|
|
|
static CCMenuItemLabel* itemWithLabel(CCNode* label, SelectorProtocol* target, SEL_MenuHandler selector);
|
|
|
|
static CCMenuItemLabel* itemWithLabel(CCNode* label);
|
|
|
|
};
|
|
|
|
|
|
|
|
class CCMenuItemAtlasFont : public CCMenuItemLabel
|
|
|
|
{
|
|
|
|
static CCMenuItemAtlasFont* itemFromString(const char *value, const char *charMapFile, int itemWidth, int itemHeight, char startCharMap);
|
|
|
|
static CCMenuItemAtlasFont* itemFromString(const char *value, const char *charMapFile, int itemWidth, int itemHeight, char startCharMap, SelectorProtocol* target, SEL_MenuHandler selector);
|
|
|
|
};
|
|
|
|
|
|
|
|
class CCMenuItemFont : public CCMenuItemLabel
|
|
|
|
{
|
|
|
|
static void setFontSize(int s);
|
|
|
|
static int fontSize();
|
|
|
|
static void setFontName(const char *name);
|
|
|
|
static const char *fontName();
|
|
|
|
static CCMenuItemFont * itemFromString(const char *value);
|
|
|
|
static CCMenuItemFont * itemFromString(const char *value, SelectorProtocol* target, SEL_MenuHandler selector);
|
|
|
|
};
|
|
|
|
|
|
|
|
class CCMenuItemSprite : public CCMenuItem
|
|
|
|
{
|
|
|
|
void setColor(ccColor3B color);
|
|
|
|
ccColor3B getColor();
|
|
|
|
void setOpacity(GLubyte opacity);
|
|
|
|
GLubyte getOpacity();
|
|
|
|
|
|
|
|
void selected();
|
|
|
|
void unselected();
|
|
|
|
void setIsEnabled(bool bEnabled);
|
|
|
|
|
|
|
|
static CCMenuItemSprite * itemFromNormalSprite(CCNode* normalSprite, CCNode* selectedSprite);
|
|
|
|
static CCMenuItemSprite * itemFromNormalSprite(CCNode* normalSprite, CCNode* selectedSprite, SelectorProtocol* target, SEL_MenuHandler selector);
|
|
|
|
static CCMenuItemSprite * itemFromNormalSprite(CCNode* normalSprite, CCNode* selectedSprite, CCNode* disabledSprite, SelectorProtocol* target, SEL_MenuHandler selector);
|
|
|
|
};
|
|
|
|
|
|
|
|
class CCMenuItemImage : public CCMenuItemSprite
|
|
|
|
{
|
|
|
|
void setColor(ccColor3B color);
|
|
|
|
ccColor3B getColor();
|
|
|
|
void setOpacity(GLubyte opacity);
|
|
|
|
GLubyte getOpacity();
|
|
|
|
|
|
|
|
static CCMenuItemImage* itemFromNormalImage(const char *normalImage, const char *selectedImage);
|
|
|
|
static CCMenuItemImage* itemFromNormalImage(const char *normalImage, const char *selectedImage, const char *disabledImage);
|
|
|
|
static CCMenuItemImage* itemFromNormalImage(const char *normalImage, const char *selectedImage, SelectorProtocol* target, SEL_MenuHandler selector);
|
|
|
|
static CCMenuItemImage* itemFromNormalImage(const char *normalImage, const char *selectedImage, const char *disabledImage, SelectorProtocol* target, SEL_MenuHandler selector);
|
|
|
|
};
|
|
|
|
|
|
|
|
class CCMenuItemToggle : public CCMenuItem
|
|
|
|
{
|
|
|
|
void addSubItem(CCMenuItem *item);
|
|
|
|
|
|
|
|
CCMenuItem* selectedItem();
|
|
|
|
void setIsEnabled(bool var);
|
|
|
|
|
|
|
|
static CCMenuItemToggle* itemWithItem(CCMenuItem *item);
|
|
|
|
};
|