CCLabelBMFont Class Reference
| Inherits from | CCSpriteBatchNode : CCNode : NSObject |
| Conforms to | CCLabelProtocol CCRGBAProtocol |
| Declared in | CCLabelBMFont.h |
Overview
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 – chage 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/ – http://www.bmglyph.com/ – http://www.n4te.com/hiero/hiero.jnlp – http://slick.cokeandcode.com/demos/hiero.jnlp – http://www.angelcode.com/products/bmfont/
Tasks
-
+ purgeCachedDataPurges the cached data. Removes from memory the cached configurations and the atlas name dictionary.
-
alignmentalignment used for the label
property -
fntFilefntFile used for the font
property -
opacityconforms to CCRGBAProtocol protocol
property -
colorconforms to CCRGBAProtocol protocol
property -
+ labelWithString:fntFile:creates a BMFont label with an initial string and the FNT file.
-
+ labelWithString:fntFile:width:alignment:creates a BMFont label with an initial string, the FNT file, width, and alignment option
-
+ labelWithString:fntFile:width:alignment:imageOffset:creates a BMFont label with an initial string, the FNT file, width, alignment option and the offset of where the glyphs start on the .PNG image
-
– initWithString:fntFile:init a BMFont label with an initial string and the FNT file
-
– initWithString:fntFile:width:alignment:init a BMFont label with an initial string and the FNT file, width, and alignment option
-
– initWithString:fntFile:width:alignment:imageOffset:init a BMFont label with an initial string and the FNT file, width, alignment option and the offset of where the glyphs start on the .PNG image
-
– createFontCharsupdates the font chars based on the string to render
-
– setWidth:set label width
-
– setAlignment:set label alignment
Properties
alignment
alignment used for the label
@property (nonatomic, assign, readonly) CCTextAlignment alignmentDeclared In
CCLabelBMFont.hcolor
conforms to CCRGBAProtocol protocol
@property (nonatomic, readwrite) ccColor3B colorDeclared In
CCLabelBMFont.hClass Methods
labelWithString:fntFile:
creates a BMFont label with an initial string and the FNT file.
+ (id)labelWithString:(NSString *)string fntFile:(NSString *)fntFileDeclared In
CCLabelBMFont.hlabelWithString:fntFile:width:alignment:
creates a BMFont label with an initial string, the FNT file, width, and alignment option
+ (id)labelWithString:(NSString *)string fntFile:(NSString *)fntFile width:(float)width alignment:(CCTextAlignment)alignmentDeclared In
CCLabelBMFont.hlabelWithString:fntFile:width:alignment:imageOffset:
creates a BMFont label with an initial string, the FNT file, width, alignment option and the offset of where the glyphs start on the .PNG image
+ (id)labelWithString:(NSString *)string fntFile:(NSString *)fntFile width:(float)width alignment:(CCTextAlignment)alignment imageOffset:(CGPoint)offsetDeclared In
CCLabelBMFont.hInstance Methods
createFontChars
updates the font chars based on the string to render
- (void)createFontCharsDeclared In
CCLabelBMFont.hinitWithString:fntFile:
init a BMFont label with an initial string and the FNT file
- (id)initWithString:(NSString *)string fntFile:(NSString *)fntFileDeclared In
CCLabelBMFont.hinitWithString:fntFile:width:alignment:
init a BMFont label with an initial string and the FNT file, width, and alignment option
- (id)initWithString:(NSString *)string fntFile:(NSString *)fntFile width:(float)width alignment:(CCTextAlignment)alignmentDeclared In
CCLabelBMFont.hinitWithString:fntFile:width:alignment:imageOffset:
init a BMFont label with an initial string and the FNT file, width, alignment option and the offset of where the glyphs start on the .PNG image
- (id)initWithString:(NSString *)string fntFile:(NSString *)fntFile width:(float)width alignment:(CCTextAlignment)alignment imageOffset:(CGPoint)offsetDeclared In
CCLabelBMFont.h