CCControlButton
CCControlButton
Cocos2DInheritance: System.Object → Cocos2D.CCNode → Cocos2D.CCLayer → Cocos2D.CCLayerRGBA → Cocos2D.CCControl
Implements: Cocos2D.ICCSelectorProtocol, Cocos2D.ICCFocusable, Cocos2D.ICCTargetedTouchDelegate, Cocos2D.ICCStandardTouchDelegate, Cocos2D.ICCTouchDelegate, Cocos2D.ICCKeypadDelegate, Cocos2D.ICCKeyboardDelegate, System.Collections.Generic.IComparer{Cocos2D.CCNode}, Cocos2D.ICCAccelerometerDelegate, Cocos2D.ICCRGBAProtocol
Constructors
CCControlButton()
CCControlButton()()Default ctor. Does nothing.
Example
CCControlButton(CCNode)
CCControlButton(CCNode)(Cocos2D.CCNode sprite)Parameters:
sprite (Cocos2D.CCNode)CCControlButton(CCNode, CCNode)
CCControlButton(CCNode, CCNode)(Cocos2D.CCNode label, Cocos2D.CCNode backgroundSprite)Parameters:
label (Cocos2D.CCNode)backgroundSprite (Cocos2D.CCNode)CCControlButton(string, string, float)
CCControlButton(string, string, float)(System.String title, System.String fontName, System.Single fontSize)Parameters:
title (System.String)fontName (System.String)fontSize (System.Single)Fields
Properties
Gets or sets the color
Tells whether the control is enabled.
A Boolean value that determines whether the control is highlighted.
Gets or sets the Opacity @warning If the the texture has premultiplied alpha then, the R, G and B channels will be modifed. Values goes from 0 to 255, where 255 means fully opaque.
A Boolean value that determines the control selected state.
Methods
DoesAdjustBackgroundImage()
System.Boolean DoesAdjustBackgroundImage()()Returns:
System.BooleanGetBackgroundSpriteForState(CCControlState)
Cocos2D.CCNode GetBackgroundSpriteForState(CCControlState)(Cocos2D.CCControlState state)Parameters:
state (Cocos2D.CCControlState)Returns:
Cocos2D.CCNodeExample
GetTitleBmFontForState(CCControlState)
System.String GetTitleBmFontForState(CCControlState)(Cocos2D.CCControlState state)Parameters:
state (Cocos2D.CCControlState)Returns:
System.StringGetTitleColorForState(CCControlState)
Cocos2D.CCColor3B GetTitleColorForState(CCControlState)(Cocos2D.CCControlState state)Parameters:
state (Cocos2D.CCControlState)Returns:
Cocos2D.CCColor3BExample
GetTitleForState(CCControlState)
System.String GetTitleForState(CCControlState)(Cocos2D.CCControlState state)Parameters:
state (Cocos2D.CCControlState)Returns:
System.StringExample
GetTitleLabelForState(CCControlState)
Cocos2D.CCNode GetTitleLabelForState(CCControlState)(Cocos2D.CCControlState state)Parameters:
state (Cocos2D.CCControlState)Returns:
Cocos2D.CCNodeExample
GetTitleTtfForState(CCControlState)
System.String GetTitleTtfForState(CCControlState)(Cocos2D.CCControlState state)Parameters:
state (Cocos2D.CCControlState)Returns:
System.StringGetTitleTtfSizeForState(CCControlState)
System.Single GetTitleTtfSizeForState(CCControlState)(Cocos2D.CCControlState state)Parameters:
state (Cocos2D.CCControlState)Returns:
System.SingleInit()
System.Boolean Init()()Returns:
System.BooleanExample
InitWithBackgroundSprite(CCNode)
System.Boolean InitWithBackgroundSprite(CCNode)(Cocos2D.CCNode sprite)Parameters:
sprite (Cocos2D.CCNode)Returns:
System.BooleanInitWithLabelAndBackgroundSprite(CCNode, CCNode)
System.Boolean InitWithLabelAndBackgroundSprite(CCNode, CCNode)(Cocos2D.CCNode node, Cocos2D.CCNode backgroundSprite)Parameters:
node (Cocos2D.CCNode)backgroundSprite (Cocos2D.CCNode)Returns:
System.BooleanInitWithTitleAndFontNameAndFontSize(string, string, float)
System.Boolean InitWithTitleAndFontNameAndFontSize(string, string, float)(System.String title, System.String fontName, System.Single fontSize)Parameters:
title (System.String)fontName (System.String)fontSize (System.Single)Returns:
System.BooleanNeedsLayout()
NeedsLayout()()Example
SetAdjustBackgroundImage(bool)
SetAdjustBackgroundImage(bool)(System.Boolean adjustBackgroundImage)Parameters:
adjustBackgroundImage (System.Boolean)Example
SetBackgroundSpriteForState(CCNode, CCControlState)
SetBackgroundSpriteForState(CCNode, CCControlState)(Cocos2D.CCNode sprite, Cocos2D.CCControlState state)Parameters:
sprite (Cocos2D.CCNode)state (Cocos2D.CCControlState)Example
SetBackgroundSpriteFrameForState(CCSpriteFrame, CCControlState)
SetBackgroundSpriteFrameForState(CCSpriteFrame, CCControlState)(Cocos2D.CCSpriteFrame spriteFrame, Cocos2D.CCControlState state)Parameters:
spriteFrame (Cocos2D.CCSpriteFrame)state (Cocos2D.CCControlState)Example
SetMargins(int, int)
SetMargins(int, int)(System.Int32 marginH, System.Int32 marginV)Parameters:
marginH (System.Int32)marginV (System.Int32)Example
SetTitleBmFontForState(string, CCControlState)
SetTitleBmFontForState(string, CCControlState)(System.String fntFile, Cocos2D.CCControlState state)Parameters:
fntFile (System.String)state (Cocos2D.CCControlState)Example
SetTitleColorForState(CCColor3B, CCControlState)
SetTitleColorForState(CCColor3B, CCControlState)(Cocos2D.CCColor3B color, Cocos2D.CCControlState state)Parameters:
color (Cocos2D.CCColor3B)state (Cocos2D.CCControlState)Example
SetTitleForState(string, CCControlState)
SetTitleForState(string, CCControlState)(System.String title, Cocos2D.CCControlState state)Parameters:
title (System.String)state (Cocos2D.CCControlState)Example
SetTitleLabelForState(CCNode, CCControlState)
SetTitleLabelForState(CCNode, CCControlState)(Cocos2D.CCNode titleLabel, Cocos2D.CCControlState state)Parameters:
titleLabel (Cocos2D.CCNode)state (Cocos2D.CCControlState)Example
SetTitleTtfForState(string, CCControlState)
SetTitleTtfForState(string, CCControlState)(System.String fntFile, Cocos2D.CCControlState state)Parameters:
fntFile (System.String)state (Cocos2D.CCControlState)SetTitleTtfSizeForState(float, CCControlState)
SetTitleTtfSizeForState(float, CCControlState)(System.Single size, Cocos2D.CCControlState state)Parameters:
size (System.Single)state (Cocos2D.CCControlState)TouchBegan(CCTouch)
System.Boolean TouchBegan(CCTouch)(Cocos2D.CCTouch pTouch)Returns true signaling that this node will consume the touch.
Parameters:
pTouch (Cocos2D.CCTouch)Returns:
System.BooleanExample
TouchCancelled(CCTouch)
TouchCancelled(CCTouch)(Cocos2D.CCTouch pTouch)Parameters:
pTouch (Cocos2D.CCTouch)Example
TouchEnded(CCTouch)
TouchEnded(CCTouch)(Cocos2D.CCTouch pTouch)Parameters:
pTouch (Cocos2D.CCTouch)Example
TouchMoved(CCTouch)
TouchMoved(CCTouch)(Cocos2D.CCTouch pTouch)Parameters:
pTouch (Cocos2D.CCTouch)Example