Class CCControlButton

#include <Geode/cocos/extensions/GUI/CCControlExtension/CCControlButton.h>
classCCControlButton:publiccocos2d::extension::CCControl{ ... }
No description provided
Examples0
Public static methods4
staticcocos2d::extension::CCControlButton*create(,)
No description provided
staticcocos2d::extension::CCControlButton*create(,
charconst*fontName
,
floatfontSize
)
No description provided
staticcocos2d::extension::CCControlButton*create()
No description provided
staticcocos2d::extension::CCControlButton*create()
No description provided
Public member functions57
virtualvoidneedsLayout()
No description provided
virtualvoidsetEnabled(
boolenabled
)
No description provided
virtualvoidsetSelected(
boolenabled
)
No description provided
virtualvoidsetHighlighted(
boolenabled
)
No description provided
cocos2d::CCString*getCurrentTitle()const

The current title that is displayed on the button.

cocos2d::ccColor3Bconst&getCurrentTitleColor()const

The current color used to display the title.

booldoesAdjustBackgroundImage()

Adjust the background image. YES by default. If the property is set to NO, the background will use the prefered size of the background image.

voidsetAdjustBackgroundImage(
booladjustBackgroundImage
)
No description provided
cocos2d::CCNode*getTitleLabel()const

The current title label.

voidsetTitleLabel()

The current title label.

cocos2d::extension::CCScale9Sprite*getBackgroundSprite()const

The current background sprite.

voidsetBackgroundSprite()

The current background sprite.

virtualcocos2d::CCSizegetPreferredSize()

The prefered size of the button, if label is larger it will be expanded.

virtualvoidsetPreferredSize()

The prefered size of the button, if label is larger it will be expanded.

virtualboolgetZoomOnTouchDown()

Adjust the button zooming on touchdown. Default value is YES.

virtualvoidsetZoomOnTouchDown(
boolvar
)

Adjust the button zooming on touchdown. Default value is YES.

virtualcocos2d::CCPointgetLabelAnchorPoint()
No description provided
virtualvoidsetLabelAnchorPoint()
No description provided
virtualGLubytegetOpacity()
No description provided
virtualvoidsetOpacity()
No description provided
virtualcocos2d::ccColor3Bconst&getColor()
No description provided
virtualvoidsetColor()
No description provided
boolisPushed()
No description provided
cocos2d::CCDictionary*getTitleDispatchTable()const
No description provided
voidsetTitleDispatchTable()
No description provided
cocos2d::CCDictionary*getTitleColorDispatchTable()const
No description provided
voidsetTitleColorDispatchTable()
No description provided
cocos2d::CCDictionary*getTitleLabelDispatchTable()const
No description provided
voidsetTitleLabelDispatchTable()
No description provided
cocos2d::CCDictionary*getBackgroundSpriteDispatchTable()const
No description provided
voidsetBackgroundSpriteDispatchTable()
No description provided
intgetVerticalMargin()const
No description provided
intgetHorizontalOrigin()const
No description provided
virtualvoidsetMargins(
intmarginH
,
intmarginV
)
No description provided
virtualboolinit()
No description provided
virtualboolinitWithLabelAndBackgroundSprite(,)
No description provided
virtualboolinitWithTitleAndFontNameAndFontSize(,
charconst*fontName
,
floatfontSize
)
No description provided
virtualboolinitWithBackgroundSprite()
No description provided
virtualboolccTouchBegan(,)
No description provided
virtualvoidccTouchMoved(,)
No description provided
virtualvoidccTouchEnded(,)
No description provided
virtualvoidccTouchCancelled(,)
No description provided
virtualcocos2d::CCString*getTitleForState()

Returns the title used for a state.

Parameters

state

The state that uses the title. Possible values are described in "CCControlState".
Return value
The title for the specified state.
virtualvoidsetTitleForState(,)

Sets the title string to use for the specified state. If a property is not specified for a state, the default is to use the CCButtonStateNormal value.

Parameters

title

The title string to use for the specified state.

state

The state that uses the specified title. The values are described in "CCControlState".
virtualcocos2d::ccColor3BconstgetTitleColorForState()

Returns the title color used for a state.

Parameters

state

The state that uses the specified color. The values are described in "CCControlState".
Return value
The color of the title for the specified state.
virtualvoidsetTitleColorForState(,)

Sets the color of the title to use for the specified state.

Parameters

color

The color of the title to use for the specified state.

state

The state that uses the specified color. The values are described in "CCControlState".
virtualcocos2d::CCNode*getTitleLabelForState()

Returns the title label used for a state.

Parameters

state

The state that uses the title label. Possible values are described in "CCControlState".
virtualvoidsetTitleLabelForState(,)

Sets the title label to use for the specified state. If a property is not specified for a state, the default is to use the CCButtonStateNormal value.

Parameters

title

The title label to use for the specified state.

state

The state that uses the specified title. The values are described in "CCControlState".
virtualvoidsetTitleTTFForState(
charconst*fntFile
,)
No description provided
virtualcharconst*getTitleTTFForState()
No description provided
virtualvoidsetTitleTTFSizeForState(
floatsize
,)
No description provided
virtualfloatgetTitleTTFSizeForState()
No description provided
virtualvoidsetTitleBMFontForState(
charconst*fntFile
,)

Sets the font of the label, changes the label to a CCLabelBMFont if neccessary.

Parameters

fntFile

The name of the font to change to

state

The state that uses the specified fntFile. The values are described in "CCControlState".
virtualcharconst*getTitleBMFontForState()
No description provided
virtualcocos2d::extension::CCScale9Sprite*getBackgroundSpriteForState()

Returns the background sprite used for a state.

Parameters

state

The state that uses the background sprite. Possible values are described in "CCControlState".
virtualvoidsetBackgroundSpriteForState(,)

Sets the background sprite to use for the specified button state.

Parameters

sprite

The background sprite to use for the specified state.

state

The state that uses the specified image. The values are described in "CCControlState".
virtualvoidsetBackgroundSpriteFrameForState(,)

Sets the background spriteFrame to use for the specified button state.

Parameters

spriteFrame

The background spriteFrame to use for the specified state.

state

The state that uses the specified image. The values are described in "CCControlState".
Fields16
cocos2d::CCString*m_currentTitle
;

The current title that is displayed on the button.

cocos2d::ccColor3Bm_currentTitleColor
;

The current color used to display the title.

boolm_doesAdjustBackgroundImage
;
No description provided
cocos2d::CCNode*m_titleLabel
;

The current title label.

;

The current background sprite.

cocos2d::CCSizem_preferredSize
;

The prefered size of the button, if label is larger it will be expanded.

boolm_zoomOnTouchDown
;

Adjust the button zooming on touchdown. Default value is YES.

cocos2d::CCPointm_labelAnchorPoint
;
No description provided
boolm_isPushed
;

Flag to know if the button is currently pushed.

boolm_bParentInited
;
No description provided
cocos2d::CCDictionary*m_titleDispatchTable
;
No description provided
cocos2d::CCDictionary*m_titleColorDispatchTable
;
No description provided
cocos2d::CCDictionary*m_titleLabelDispatchTable
;
No description provided
cocos2d::CCDictionary*m_backgroundSpriteDispatchTable
;
No description provided
intm_marginV
;
No description provided
intm_marginH
;
No description provided
Protected member functions0
Protected fields0
Derived classes1