A CCMenuItemToggle A simple container class that “toggles” it’s inner items The inner items can be any MenuItem
Class CCMenuItemToggle
#include <Geode/cocos/menu_nodes/CCMenuItem.h>
Examples0
Public static methods4
staticcocos2d::CCMenuItemToggle*createWithTarget(cocos2d::CCObject*target,cocos2d::SEL_MenuHandlerselector,cocos2d::CCArray*menuItems)
creates a menu item from a CCArray with a target selector
staticcocos2d::CCMenuItemToggle*createWithTarget(cocos2d::CCObject*target,cocos2d::SEL_MenuHandlerselector,)
creates a menu item from a list of items with a target/selector
staticcocos2d::CCMenuItemToggle*create()
creates a menu item with no target/selector and no items
staticcocos2d::CCMenuItemToggle*create()
creates a menu item with a item
Public member functions12
virtualuintgetSelectedIndex()
returns the selected item
virtualcocos2d::CCArray*getSubItems()
CCMutableArray that contains the subitems. You can add/remove items in runtime, and you can replace the array with a new one.
virtualvoidsetSubItems()
CCMutableArray that contains the subitems. You can add/remove items in runtime, and you can replace the array with a new one.
boolinitWithTarget(cocos2d::CCObject*target,cocos2d::SEL_MenuHandlerselector,,_::va_listargs)
initializes a menu item from a list of items with a target selector
boolinitWithItem()
initializes a menu item with a item
voidaddSubItem()
add more menu item
cocos2d::CCMenuItem*selectedItem()
return the selected item
virtualvoidactivate()
virtualvoidselected()
virtualvoidunselected()
Fields0
Protected member functions0
Protected fields2
uintm_uSelectedIndex;
returns the selected item
cocos2d::CCArray*m_pSubItems;
CCMutableArray that contains the subitems. You can add/remove items in runtime, and you can replace the array with a new one.