Struct CCMenuItemExt

#include <Geode/utils/cocos.hpp>

Contains various utility functions related to CCMenuItem set of classes.

Fields0
Examples0
Public static methods11
staticcocos2d::CCMenuItem*create()

Creates a CCMenuItem with a callback.

Parameters

callback

The callback for the button
Return value
The created button
staticcocos2d::CCMenuItemSprite*createSprite(
cocos2d::CCNode*normalSprite
,
cocos2d::CCNode*selectedSprite
,)

Creates a CCMenuItemSprite with a normal and a selected sprite.

Parameters

normalSprite

The sprite used on idle

selectedSprite

The sprite used when selected

callback

The callback for the button
Return value
The created button
staticcocos2d::CCMenuItemSprite*createSprite(
cocos2d::CCNode*normalSprite
,
cocos2d::CCNode*selectedSprite
,
cocos2d::CCNode*disabledSprite
,)

Creates a CCMenuItemSprite with a disabled, normal and a selected sprite.

Parameters

normalSprite

The sprite used on idle

selectedSprite

The sprite used when selected

disabledSprite

The sprite used when disabled

callback

The callback for the button
Return value
The created button
staticCCMenuItemSpriteExtra*createSpriteExtra(
cocos2d::CCNode*normalSprite
,)

Creates a CCMenuItemSpriteExtra with a sprite and a callback.

Parameters

normalSprite

The sprite for the button

callback

The callback for the button
Return value
The created button
staticCCMenuItemSpriteExtra*createSpriteExtraWithFilename(
std::string_viewnormalSpriteName
,
floatscale
,)

Creates a CCMenuItemSpriteExtra with a file name and a sprite scale.

Parameters

normalSpriteName

The file name used for the normal sprite

scale

The scale used for the sprite

callback

The callback for the button
Return value
The created button
staticCCMenuItemSpriteExtra*createSpriteExtraWithFrameName(
std::string_viewnormalSpriteName
,
floatscale
,)

Creates a CCMenuItemSpriteExtra with a frame name and a sprite scale.

Parameters

normalSpriteName

The frame name used for the normal sprite

scale

The scale used for the sprite

callback

The callback for the button
Return value
The created button
staticCCMenuItemToggler*createToggler(,,)

Creates a CCMenuItemToggler with an on and off sprite.

Parameters

onSprite

The sprite used when toggled on

offSprite

The sprite used when toggled off

callback

The callback for the toggle
Return value
The created toggle
staticCCMenuItemToggler*createTogglerWithStandardSprites(
floatscale
,)

Creates a CCMenuItemToggler with standard toggle sprites GD uses.

Parameters

scale

The scale of the sprites

callback

The callback for the toggle
Return value
The created toggle
staticCCMenuItemToggler*createTogglerWithFilename(
std::string_viewonSpriteName
,
std::string_viewoffSpriteName
,
floatscale
,)

Creates a CCMenuItemToggler with an on and off sprite file name

Parameters

onSpriteName

The file name thats used to create the toggled on sprite

offSpriteName

The file name thats used to create the toggled off sprite

callback

The callback for the toggle
Return value
The created toggle
staticCCMenuItemToggler*createTogglerWithFrameName(
std::string_viewonSpriteName
,
std::string_viewoffSpriteName
,
floatscale
,)

Creates a CCMenuItemToggler with an on and off sprite frame name

Parameters

onSpriteName

The frame name thats used to create the toggled on sprite

offSpriteName

The frame name thats used to create the toggled off sprite

callback

The callback for the toggle
Return value
The created toggle
template<class Node>staticvoidassignCallback(,)

Assigns a lambda callback to a CCMenuItem

Parameters

item

The item to assign callback to

callback

The callback to assign
Public member functions0