Skip to main content

CCLabelBMFont

CCLabelBMFont

Cocos2D

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

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

CCLabelBMFont()

CCLabelBMFont()()

CCLabelBMFont(string, string)

CCLabelBMFont(string, string)(System.String str, System.String fntFile)
Parameters:
str (System.String)
fntFile (System.String)

CCLabelBMFont(string, string, float)

CCLabelBMFont(string, string, float)(System.String str, System.String fntFile, System.Single width)
Parameters:
str (System.String)
fntFile (System.String)
width (System.Single)

CCLabelBMFont(string, string, float, CCTextAlignment)

CCLabelBMFont(string, string, float, CCTextAlignment)(System.String str, System.String fntFile, System.Single width, Cocos2D.CCTextAlignment alignment)
Parameters:
str (System.String)
fntFile (System.String)
width (System.Single)
alignment (Cocos2D.CCTextAlignment)

CCLabelBMFont(string, string, float, CCTextAlignment, CCPoint)

CCLabelBMFont(string, string, float, CCTextAlignment, CCPoint)(System.String str, System.String fntFile, System.Single width, Cocos2D.CCTextAlignment alignment, Cocos2D.CCPoint imageOffset)
Parameters:
str (System.String)
fntFile (System.String)
width (System.Single)
alignment (Cocos2D.CCTextAlignment)
imageOffset (Cocos2D.CCPoint)

Fields

kCCLabelAutomaticWidth(System.Int32)
m_bCascadeColorEnabled(System.Boolean)
m_bCascadeOpacityEnabled(System.Boolean)
m_bIsOpacityModifyRGB(System.Boolean)
m_bLabelDirty(System.Boolean)
m_bLineBreakWithoutSpaces(System.Boolean)
m_cDisplayedOpacity(System.Byte)
m_cRealOpacity(System.Byte)
m_pConfiguration(Cocos2D.CCBMFontConfiguration)
m_pHAlignment(Cocos2D.CCTextAlignment)
m_pLineBreakMode(Cocos2D.CCTextLineBreakMode)
m_pReusedChar(Cocos2D.CCSprite)
m_pVAlignment(Cocos2D.CCVerticalTextAlignment)
m_sFntFile(System.String)
m_sInitialString(System.String)
m_sString(System.String)
m_tDimensions(Cocos2D.CCSize)
m_tDisplayedColor(Cocos2D.CCColor3B)
m_tImageOffset(Cocos2D.CCPoint)
m_tRealColor(Cocos2D.CCColor3B)
s_pConfigurations(System.Collections.Generic.DictionarySystem.String,Cocos2D.CCBMFontConfiguration)

Properties

AnchorPoint(Cocos2D.CCPoint)

returns the Anchor Point of the node as a value [0,1], where 1 is 100% of the dimension and 0 is 0%.

CascadeColorEnabled(System.Boolean)

returns whether or not the opacity will be applied using glColor(R,G,B,opacity) or glColor(opacity, opacity, opacity, opacity); @since v0.8 whether or not color should be propagated to its children.

CascadeOpacityEnabled(System.Boolean)

whether or not opacity should be propagated to its children.

Color(Cocos2D.CCColor3B)

Gets or sets the color

Dimensions(Cocos2D.CCSize)
DisplayedColor(Cocos2D.CCColor3B)
DisplayedOpacity(System.Byte)
FntFile(System.String)
HorizontalAlignment(Cocos2D.CCTextAlignment)
IsOpacityModifyRGB(System.Boolean)

sets the premultipliedAlphaOpacity property. If set to NO then opacity will be applied as: glColor(R,G,B,opacity); If set to YES then oapcity will be applied as: glColor(opacity, opacity, opacity, opacity ); Textures with premultiplied alpha will have this property by default on YES. Otherwise the default value is NO @since v0.8

LineBreakMode(Cocos2D.CCTextLineBreakMode)
LineBreakWithoutSpace(System.Boolean)
Opacity(System.Byte)

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.

Scale(System.Single)

The general scale that applies to both X and Y directions.

ScaleX(System.Single)

Scale of the node in the X direction (left to right)

ScaleY(System.Single)

Scale of the node in the Y direction (top to bottom)

Text(System.String)
VerticalAlignment(Cocos2D.CCVerticalTextAlignment)

Methods

CreateFontChars()

CreateFontChars()()

FNTConfigLoadFile(string)

Cocos2D.CCBMFontConfiguration FNTConfigLoadFile(string)(System.String file)
Parameters:
file (System.String)
Returns:
Cocos2D.CCBMFontConfiguration

FNTConfigLoadFile(string, Stream)

Cocos2D.CCBMFontConfiguration FNTConfigLoadFile(string, Stream)(System.String fntName, System.IO.Stream src)
Parameters:
fntName (System.String)
src (System.IO.Stream)
Returns:
Cocos2D.CCBMFontConfiguration

FNTConfigRemoveCache()

FNTConfigRemoveCache()()

Init()

System.Boolean Init()()
Returns:
System.Boolean
Example

InitWithString(string, string, CCSize, CCTextAlignment, CCVerticalTextAlignment, CCPoint, CCTexture2D)

System.Boolean InitWithString(string, string, CCSize, CCTextAlignment, CCVerticalTextAlignment, CCPoint, CCTexture2D)(System.String theString, System.String fntFile, Cocos2D.CCSize dimentions, Cocos2D.CCTextAlignment hAlignment, Cocos2D.CCVerticalTextAlignment vAlignment, Cocos2D.CCPoint imageOffset, Cocos2D.CCTexture2D texture)
Parameters:
theString (System.String)
fntFile (System.String)
dimentions (Cocos2D.CCSize)
hAlignment (Cocos2D.CCTextAlignment)
vAlignment (Cocos2D.CCVerticalTextAlignment)
imageOffset (Cocos2D.CCPoint)
texture (Cocos2D.CCTexture2D)
Returns:
System.Boolean

InitWithString(string, string, CCSize, CCTextAlignment, CCVerticalTextAlignment, CCPoint, CCTexture2D, CCBMFontConfiguration)

System.Boolean InitWithString(string, string, CCSize, CCTextAlignment, CCVerticalTextAlignment, CCPoint, CCTexture2D, CCBMFontConfiguration)(System.String text, System.String fntFile, Cocos2D.CCSize dimensions, Cocos2D.CCTextAlignment hAlignment, Cocos2D.CCVerticalTextAlignment vAlignment, Cocos2D.CCPoint imageOffset, Cocos2D.CCTexture2D texture, Cocos2D.CCBMFontConfiguration configuration)
Parameters:
text (System.String)
fntFile (System.String)
dimensions (Cocos2D.CCSize)
hAlignment (Cocos2D.CCTextAlignment)
vAlignment (Cocos2D.CCVerticalTextAlignment)
imageOffset (Cocos2D.CCPoint)
texture (Cocos2D.CCTexture2D)
configuration (Cocos2D.CCBMFontConfiguration)
Returns:
System.Boolean

PurgeCachedData()

PurgeCachedData()()

SetString(string, bool)

SetString(string, bool)(System.String newString, System.Boolean needUpdateLabel)
Parameters:
newString (System.String)
needUpdateLabel (System.Boolean)

UpdateDisplayedColor(CCColor3B)

UpdateDisplayedColor(CCColor3B)(Cocos2D.CCColor3B parentColor)

recursive method that updates display color

Parameters:
parentColor (Cocos2D.CCColor3B)
Example

UpdateDisplayedOpacity(byte)

UpdateDisplayedOpacity(byte)(System.Byte parentOpacity)

recursive method that updates the displayed opacity.

Parameters:
parentOpacity (System.Byte)
Example

UpdateLabel()

UpdateLabel()()

Visit()

Visit()()

This is called with every call to the MainLoop on the CCDirector class. In XNA, this is the same as the Draw() call.

Example