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
-
+ purgeCachedData
Purges the cached data. Removes from memory the cached configurations and the atlas name dictionary.
-
alignment
alignment used for the label
property -
fntFile
fntFile used for the font
property -
opacity
conforms to CCRGBAProtocol protocol
property -
color
conforms 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
-
– createFontChars
updates 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 alignment
Declared In
CCLabelBMFont.h
color
conforms to CCRGBAProtocol protocol
@property (nonatomic, readwrite) ccColor3B color
Declared In
CCLabelBMFont.h
Class Methods
labelWithString:fntFile:
creates a BMFont label with an initial string and the FNT file.
+ (id)labelWithString:(NSString *)string fntFile:(NSString *)fntFile
Declared In
CCLabelBMFont.h
labelWithString: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)alignment
Declared In
CCLabelBMFont.h
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
+ (id)labelWithString:(NSString *)string fntFile:(NSString *)fntFile width:(float)width alignment:(CCTextAlignment)alignment imageOffset:(CGPoint)offset
Declared In
CCLabelBMFont.h
Instance Methods
createFontChars
updates the font chars based on the string to render
- (void)createFontChars
Declared In
CCLabelBMFont.h
initWithString:fntFile:
init a BMFont label with an initial string and the FNT file
- (id)initWithString:(NSString *)string fntFile:(NSString *)fntFile
Declared In
CCLabelBMFont.h
initWithString: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)alignment
Declared In
CCLabelBMFont.h
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
- (id)initWithString:(NSString *)string fntFile:(NSString *)fntFile width:(float)width alignment:(CCTextAlignment)alignment imageOffset:(CGPoint)offset
Declared In
CCLabelBMFont.h