CCLabelBMFont
CCLabelBMFont
Cocos2DInheritance: 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
Properties
returns the Anchor Point of the node as a value [0,1], where 1 is 100% of the dimension and 0 is 0%.
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.
whether or not opacity should be propagated to its children.
Gets or sets the color
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
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.
The general scale that applies to both X and Y directions.
Scale of the node in the X direction (left to right)
Scale of the node in the Y direction (top to bottom)
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