Class CCMenu

#include <Geode/cocos/menu_nodes/CCMenu.h>
classCCMenu:publiccocos2d::CCLayerRGBA{ ... }

A CCMenu

Features and Limitation:

  • You can add MenuItem objects in runtime using addChild:
  • But the only accepted children are MenuItem objects
Examples0
Public static methods5
staticcocos2d::CCMenu*create()

creates an empty CCMenu

staticcocos2d::CCMenu*create()

creates a CCMenu with CCMenuItem objects

staticcocos2d::CCMenu*createWithArray(
cocos2d::CCArray*pArrayOfItems
)

creates a CCMenu with a CCArray of CCMenuItem objects

staticcocos2d::CCMenu*createWithItem()

creates a CCMenu with it’s item, then use addChild() to add other items. It is used for script, it can’t init with undetermined number of variables.

staticcocos2d::CCMenu*createWithItems(,)

creates a CCMenu with CCMenuItem objects

Public member functions27
virtualboolinit()

initializes an empty CCMenu

boolinitWithArray(
cocos2d::CCArray*pArrayOfItems
)

initializes a CCMenu with a NSArray of CCMenuItem objects

voidalignItemsVertically()

align items vertically

voidalignItemsVerticallyWithPadding(
floatpadding
)

Since v0.7.2

align items vertically with padding

voidalignItemsHorizontally()

align items horizontally

voidalignItemsHorizontallyWithPadding(
floatpadding
)

Since v0.7.2

align items horizontally with padding

voidalignItemsInColumns(
uintcolumns
)

align items in rows of columns

when this function bound to js,the input params are changed
js:var alignItemsInColumns(...)
voidalignItemsInColumns(
uintcolumns
,)
No description provided
voidalignItemsInColumnsWithArray()
No description provided
voidalignItemsInRows(
uintrows
)

align items in columns of rows

when this function bound to js,the input params are changed
js:var alignItemsInRows(...)
voidalignItemsInRows(
uintrows
,)
No description provided
voidalignItemsInRowsWithArray()
No description provided
voidsetHandlerPriority(
intnewPriority
)

set event handler priority. By default it is: kCCMenuTouchPriority

virtualvoidaddChild()
No description provided
virtualvoidaddChild(,
intzOrder
)
No description provided
virtualvoidaddChild(,
intzOrder
,
inttag
)
No description provided
virtualvoidregisterWithTouchDispatcher()
No description provided
virtualvoidremoveChild(,
boolcleanup
)
No description provided
virtualboolccTouchBegan(,)

For phone event handle functions

virtualvoidccTouchEnded(,)
No description provided
virtualvoidccTouchCancelled(,)
No description provided
virtualvoidccTouchMoved(,)
No description provided
virtualvoidonExit()

Since v0.99.5 override onExit

No description provided
virtualvoidsetOpacityModifyRGB(
boolbValue
)
No description provided
virtualboolisOpacityModifyRGB()
No description provided
virtualboolisEnabled()
No description provided
virtualvoidsetEnabled(
boolvalue
)
No description provided
Fields0
Protected member functions2
cocos2d::CCMenuItem*itemForTouch()
No description provided
cocos2d::CCMenuItem*itemForTouch(,)
No description provided
Protected fields2
;
No description provided
cocos2d::CCMenuItem*m_pSelectedItem
;
No description provided