The current title that is displayed on the button.
Class CCControlButton
#include <Geode/cocos/extensions/GUI/CCControlExtension/CCControlButton.h>Examples0
Public static methods4
staticcocos2d::extension::CCControlButton*create(cocos2d::CCNode*label,cocos2d::extension::CCScale9Sprite*backgroundSprite)
staticcocos2d::extension::CCControlButton*create(gd::stringtitle,charconst*fontName,floatfontSize)
staticcocos2d::extension::CCControlButton*create()
staticcocos2d::extension::CCControlButton*create()
Public member functions57
virtualvoidneedsLayout()
cocos2d::CCString*getCurrentTitle()const
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.
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.
virtualcocos2d::CCPointgetLabelAnchorPoint()
virtualvoidsetLabelAnchorPoint()
virtualGLubytegetOpacity()
virtualcocos2d::ccColor3Bconst&getColor()
virtualvoidsetColor()
boolisPushed()
cocos2d::CCDictionary*getTitleDispatchTable()const
voidsetTitleDispatchTable()
cocos2d::CCDictionary*getTitleColorDispatchTable()const
voidsetTitleColorDispatchTable()
cocos2d::CCDictionary*getTitleLabelDispatchTable()const
voidsetTitleLabelDispatchTable()
cocos2d::CCDictionary*getBackgroundSpriteDispatchTable()const
voidsetBackgroundSpriteDispatchTable()
intgetVerticalMargin()const
intgetHorizontalOrigin()const
virtualboolinit()
virtualboolinitWithLabelAndBackgroundSprite(cocos2d::CCNode*label,cocos2d::extension::CCScale9Sprite*backgroundSprite)
virtualboolinitWithTitleAndFontNameAndFontSize(gd::stringtitle,charconst*fontName,floatfontSize)
virtualboolinitWithBackgroundSprite()
virtualboolccTouchBegan(cocos2d::CCTouch*pTouch,cocos2d::CCEvent*pEvent)
virtualvoidccTouchMoved(cocos2d::CCTouch*pTouch,cocos2d::CCEvent*pEvent)
virtualvoidccTouchEnded(cocos2d::CCTouch*pTouch,cocos2d::CCEvent*pEvent)
virtualvoidccTouchCancelled(cocos2d::CCTouch*pTouch,cocos2d::CCEvent*pEvent)
virtualcocos2d::CCString*getTitleForState()
Returns the title used for a state.
state
virtualvoidsetTitleForState(cocos2d::CCString*title,)
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.
title
state
virtualcocos2d::ccColor3BconstgetTitleColorForState()
Returns the title color used for a state.
state
virtualvoidsetTitleColorForState(cocos2d::ccColor3Bcolor,)
Sets the color of the title to use for the specified state.
color
state
virtualcocos2d::CCNode*getTitleLabelForState()
Returns the title label used for a state.
state
virtualvoidsetTitleLabelForState(cocos2d::CCNode*label,)
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.
title
state
virtualvoidsetTitleTTFForState(charconst*fntFile,)
virtualcharconst*getTitleTTFForState()
virtualfloatgetTitleTTFSizeForState()
virtualvoidsetTitleBMFontForState(charconst*fntFile,)
Sets the font of the label, changes the label to a CCLabelBMFont if neccessary.
fntFile
state
virtualcharconst*getTitleBMFontForState()
virtualcocos2d::extension::CCScale9Sprite*getBackgroundSpriteForState()
Returns the background sprite used for a state.
state
virtualvoidsetBackgroundSpriteForState(,)
Sets the background sprite to use for the specified button state.
sprite
state
virtualvoidsetBackgroundSpriteFrameForState(cocos2d::CCSpriteFrame*spriteFrame,)
Sets the background spriteFrame to use for the specified button state.
spriteFrame
state
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;
cocos2d::CCNode*m_titleLabel;
The current title label.
cocos2d::extension::CCScale9Sprite*m_backgroundSprite;
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;
boolm_isPushed;
Flag to know if the button is currently pushed.