Class CCMenuItemSprite

#include <Geode/cocos/menu_nodes/CCMenuItem.h>
classCCMenuItemSprite:publiccocos2d::CCMenuItem{ ... }

Since v0.8.0

CCMenuItemSprite accepts CCNode<CCRGBAProtocol> objects as items. The images has 3 different states:

  • unselected image
  • selected image
  • disabled image
Examples0
Public static methods3
staticcocos2d::CCMenuItemSprite*create(
cocos2d::CCNode*normalSprite
,
cocos2d::CCNode*selectedSprite
,
cocos2d::CCNode*disabledSprite
)

creates a menu item with a normal, selected and disabled image

staticcocos2d::CCMenuItemSprite*create(
cocos2d::CCNode*normalSprite
,
cocos2d::CCNode*selectedSprite
,,)

creates a menu item with a normal and selected image with target/selector

staticcocos2d::CCMenuItemSprite*create(
cocos2d::CCNode*normalSprite
,
cocos2d::CCNode*selectedSprite
,
cocos2d::CCNode*disabledSprite
,,)

creates a menu item with a normal,selected and disabled image with target/selector

Public member functions10
virtualcocos2d::CCNode*getNormalImage()

the image used when the item is not selected

virtualvoidsetNormalImage()

the image used when the item is not selected

virtualcocos2d::CCNode*getSelectedImage()

the image used when the item is selected

virtualvoidsetSelectedImage()

the image used when the item is selected

virtualcocos2d::CCNode*getDisabledImage()

the image used when the item is disabled

virtualvoidsetDisabledImage()

the image used when the item is disabled

boolinitWithNormalSprite(
cocos2d::CCNode*normalSprite
,
cocos2d::CCNode*selectedSprite
,
cocos2d::CCNode*disabledSprite
,,)

initializes a menu item with a normal, selected and disabled image with target/selector

virtualvoidselected()

Since v0.99.5

No description provided
virtualvoidunselected()
No description provided
virtualvoidsetEnabled(
boolbEnabled
)
No description provided
Fields0
Protected member functions1
virtualvoidupdateImagesVisibility()
No description provided
Protected fields3
cocos2d::CCNode*m_pNormalImage
;

the image used when the item is not selected

cocos2d::CCNode*m_pSelectedImage
;

the image used when the item is selected

cocos2d::CCNode*m_pDisabledImage
;

the image used when the item is disabled