Skip to main content

CCLabel

CCLabel

Cocos2D

Inheritance: System.Object → Cocos2D.CCNode → Cocos2D.CCSpriteBatchNode → Cocos2D.CCLabelBMFont

Implements: Cocos2D.ICCSelectorProtocol, Cocos2D.ICCFocusable, Cocos2D.ICCTargetedTouchDelegate, Cocos2D.ICCStandardTouchDelegate, Cocos2D.ICCTouchDelegate, Cocos2D.ICCKeypadDelegate, Cocos2D.ICCKeyboardDelegate, System.Collections.Generic.IComparer{Cocos2D.CCNode}, Cocos2D.ICCTextureProtocol, Cocos2D.ICCBlendProtocol, Cocos2D.ICCLabelProtocol, Cocos2D.ICCRGBAProtocol

Constructors

CCLabel()

CCLabel()()

CCLabel(string, string, float)

CCLabel(string, string, float)(System.String text, System.String fontName, System.Single fontSize)
Parameters:
text (System.String)
fontName (System.String)
fontSize (System.Single)

CCLabel(string, string, float, CCSize)

CCLabel(string, string, float, CCSize)(System.String text, System.String fontName, System.Single fontSize, Cocos2D.CCSize dimensions)
Parameters:
text (System.String)
fontName (System.String)
fontSize (System.Single)
dimensions (Cocos2D.CCSize)

CCLabel(string, string, float, CCSize, CCTextAlignment)

CCLabel(string, string, float, CCSize, CCTextAlignment)(System.String text, System.String fontName, System.Single fontSize, Cocos2D.CCSize dimensions, Cocos2D.CCTextAlignment hAlignment)
Parameters:
text (System.String)
fontName (System.String)
fontSize (System.Single)
dimensions (Cocos2D.CCSize)
hAlignment (Cocos2D.CCTextAlignment)

CCLabel(string, string, float, CCSize, CCTextAlignment, CCVerticalTextAlignment)

CCLabel(string, string, float, CCSize, CCTextAlignment, CCVerticalTextAlignment)(System.String text, System.String fontName, System.Single fontSize, Cocos2D.CCSize dimensions, Cocos2D.CCTextAlignment hAlignment, Cocos2D.CCVerticalTextAlignment vAlignment)
Parameters:
text (System.String)
fontName (System.String)
fontSize (System.Single)
dimensions (Cocos2D.CCSize)
hAlignment (Cocos2D.CCTextAlignment)
vAlignment (Cocos2D.CCVerticalTextAlignment)

CCLabel(string, string, float, CCTextAlignment)

CCLabel(string, string, float, CCTextAlignment)(System.String text, System.String fontName, System.Single fontSize, Cocos2D.CCTextAlignment hAlignment)
Parameters:
text (System.String)
fontName (System.String)
fontSize (System.Single)
hAlignment (Cocos2D.CCTextAlignment)

CCLabel(string, string, float, CCTextAlignment, CCVerticalTextAlignment)

CCLabel(string, string, float, CCTextAlignment, CCVerticalTextAlignment)(System.String text, System.String fontName, System.Single fontSize, Cocos2D.CCTextAlignment hAlignment, Cocos2D.CCVerticalTextAlignment vAlignment)
Parameters:
text (System.String)
fontName (System.String)
fontSize (System.Single)
hAlignment (Cocos2D.CCTextAlignment)
vAlignment (Cocos2D.CCVerticalTextAlignment)

Fields

m_FontName(System.String)
m_FontSize(System.Single)
m_FontSpacing(System.Int32)
m_bFontDirty(System.Boolean)
m_bTextureDirty(System.Boolean)
m_pData(System.Int32[])
m_pTexture(Cocos2D.CCTexture2D)

Properties

SystemFont(System.String)
SystemFontSize(System.Single)
SystemFontSpacing(System.Int32)
Text(System.String)

Methods

AllocateRegion(int, int)

Cocos2D.CCLabel.ivec4 AllocateRegion(int, int)(System.Int32 width, System.Int32 height)
Parameters:
width (System.Int32)
height (System.Int32)
Returns:
Cocos2D.CCLabel.ivec4

Draw()

Draw()()

This is called from the Visit() method. This is where you DRAW your node. Only draw stuff from this method call.

Example

InitWithString(string, string, float)

System.Boolean InitWithString(string, string, float)(System.String text, System.String fontName, System.Single fontSize)
Parameters:
text (System.String)
fontName (System.String)
fontSize (System.Single)
Returns:
System.Boolean

InitWithString(string, string, float, CCSize, CCTextAlignment)

System.Boolean InitWithString(string, string, float, CCSize, CCTextAlignment)(System.String text, System.String fontName, System.Single fontSize, Cocos2D.CCSize dimensions, Cocos2D.CCTextAlignment hAlignment)
Parameters:
text (System.String)
fontName (System.String)
fontSize (System.Single)
dimensions (Cocos2D.CCSize)
hAlignment (Cocos2D.CCTextAlignment)
Returns:
System.Boolean

InitWithString(string, string, float, CCSize, CCTextAlignment, CCVerticalTextAlignment)

System.Boolean InitWithString(string, string, float, CCSize, CCTextAlignment, CCVerticalTextAlignment)(System.String text, System.String fontName, System.Single fontSize, Cocos2D.CCSize dimensions, Cocos2D.CCTextAlignment hAlignment, Cocos2D.CCVerticalTextAlignment vAlignment)
Parameters:
text (System.String)
fontName (System.String)
fontSize (System.Single)
dimensions (Cocos2D.CCSize)
hAlignment (Cocos2D.CCTextAlignment)
vAlignment (Cocos2D.CCVerticalTextAlignment)
Returns:
System.Boolean

InitializeTTFAtlas(int, int)

InitializeTTFAtlas(int, int)(System.Int32 width, System.Int32 height)
Parameters:
width (System.Int32)
height (System.Int32)

ReleaseResources()

ReleaseResources()()

SetRegionData(ivec4, int[], int)

SetRegionData(ivec4, int[], int)(Cocos2D.CCLabel.ivec4 region, System.Int32[] data, System.Int32 stride)
Parameters:
region (Cocos2D.CCLabel.ivec4)
data (System.Int32[])
stride (System.Int32)

SetTTFAtlasTextureSize(float, float)

SetTTFAtlasTextureSize(float, float)(System.Single width, System.Single height)
Parameters:
width (System.Single)
height (System.Single)