Class CCLabelBMFont

#include <Geode/cocos/label_nodes/CCLabelBMFont.h>

Since v0.8

CCLabelBMFont is a subclass of CCSpriteBatchNode. Features:

  • Treats each character like a CCSprite. This means that each individual character can be:
  • rotated
  • scaled
  • translated
  • tinted
  • change the opacity
  • It can be used as part of a menu item.
  • anchorPoint can be used to align the “label”
  • Supports AngelCode text format Limitations:
  • All inner characters are using an anchorPoint of (0.5f, 0.5f) and it is not recommend to change it because it might affect the rendering CCLabelBMFont implements the protocol CCLabelProtocol, like CCLabel and CCLabelAtlas. CCLabelBMFont has the flexibility of CCLabel, the speed of CCLabelAtlas and all the features of CCSprite. If in doubt, use CCLabelBMFont instead of CCLabelAtlas / CCLabel. Supported editors: http://glyphdesigner.71squared.com/ (Commercial, Mac OS X) http://www.n4te.com/hiero/hiero.jnlp (Free, Java) http://slick.cokeandcode.com/demos/hiero.jnlp (Free, Java) http://www.angelcode.com/products/bmfont/ (Free, Windows only)
Examples0
Public static methods7
staticvoidpurgeCachedData()

Since v0.99.3

Purges the cached data. Removes from memory the cached configurations and the atlas name dictionary.

staticcocos2d::CCLabelBMFont*create(,
charconst*fntFile
,
floatwidth
,,
cocos2d::CCPointimageOffset
)

creates a bitmap font atlas with an initial string and the FNT file

staticcocos2d::CCLabelBMFont*create(,
charconst*fntFile
,
floatwidth
,)
No description provided
staticcocos2d::CCLabelBMFont*create(,
charconst*fntFile
,
floatwidth
)
No description provided
staticcocos2d::CCLabelBMFont*create(,
charconst*fntFile
)
No description provided
staticcocos2d::CCLabelBMFont*create()

Creates an label.

staticcocos2d::CCLabelBMFont*createBatched(,
charconst*fntFile
,,)
No description provided
Public member functions39
virtualboolinit()
No description provided
boolinitWithString(,
charconst*fntFile
,
floatwidth
,,
cocos2d::CCPointimageOffset
)

init a bitmap font atlas with an initial string and the FNT file

voidcreateFontChars()

updates the font chars based on the string to render

virtualvoidsetString(
charconst*newString
)
No description provided
virtualvoidsetString(
charconst*newString
,
boolneedUpdateLabel
)
No description provided
virtualcharconst*getString()
No description provided
virtualvoidsetCString()
No description provided
virtualvoidsetAnchorPoint()
No description provided
virtualvoidupdateLabel()
No description provided
virtualvoidsetAlignment()
No description provided
virtualvoidsetWidth(
floatwidth
)
No description provided
virtualvoidsetLineBreakWithoutSpace(
boolbreakWithoutSpace
)
No description provided
virtualvoidsetScale(
floatscale
)
No description provided
virtualvoidsetScaleX(
floatscaleX
)
No description provided
virtualvoidsetScaleY(
floatscaleY
)
No description provided
virtualboolisOpacityModifyRGB()
No description provided
virtualvoidsetOpacityModifyRGB(
boolisOpacityModifyRGB
)
No description provided
virtual_::GLubytegetOpacity()
No description provided
virtual_::GLubytegetDisplayedOpacity()
No description provided
virtualvoidsetOpacity(
_::GLubyteopacity
)
No description provided
virtualvoidupdateDisplayedOpacity(
_::GLubyteparentOpacity
)
No description provided
virtualboolisCascadeOpacityEnabled()
No description provided
virtualvoidsetCascadeOpacityEnabled(
boolcascadeOpacityEnabled
)
No description provided
virtualcocos2d::ccColor3Bconst&getColor()
No description provided
virtualcocos2d::ccColor3Bconst&getDisplayedColor()
No description provided
virtualvoidsetColor()
No description provided
virtualvoidupdateDisplayedColor()
No description provided
virtualboolisCascadeColorEnabled()
No description provided
virtualvoidsetCascadeColorEnabled(
boolcascadeColorEnabled
)
No description provided
voidsetFntFile(
charconst*fntFile
)
No description provided
charconst*getFntFile()
No description provided
cocos2d::CCBMFontConfiguration*getConfiguration()const
No description provided
voidlimitLabelWidth(
floatwidth
,
floatdefaultScale
,
floatminScale
)
No description provided
intgetExtraKerning()const
No description provided
voidsetExtraKerning(
intextraKerning
)
No description provided
boolgetIsBatched()const
No description provided
voidsetIsBatched()
No description provided
cocos2d::CCArray*getTargetArray()const
No description provided
voidsetTargetArray()
No description provided
Fields0
Protected member functions1
virtualvoidsetString(,
boolneedUpdateLabel
)
No description provided
Protected fields21
;
No description provided
gd::stringm_sFntFile
;
No description provided
unsigned short*m_sInitialString
;
No description provided
gd::stringm_sInitialStringUTF8
;
No description provided
;
No description provided
floatm_fWidth
;
No description provided
;
No description provided
boolm_bLineBreakWithoutSpaces
;
No description provided
cocos2d::CCPointm_tImageOffset
;
No description provided
cocos2d::CCSprite*m_pReusedChar
;
No description provided
_::GLubytem_cDisplayedOpacity
;
No description provided
_::GLubytem_cRealOpacity
;
No description provided
cocos2d::ccColor3Bm_tDisplayedColor
;
No description provided
cocos2d::ccColor3Bm_tRealColor
;
No description provided
boolm_bCascadeColorEnabled
;
No description provided
boolm_bCascadeOpacityEnabled
;
No description provided
boolm_bIsOpacityModifyRGB
;

conforms to CCRGBAProtocol protocol

boolm_bIsBatched
;
No description provided
cocos2d::CCArray*m_pTargetArray
;
No description provided
cocos2d::CCTexture2D*m_pSomeTexture
;
No description provided
intm_nExtraKerning
;
No description provided