![]() |
cocos2d-iphone
2.1
Improved Cocos2D API Reference (iOS version) for www.kobold2d.com developers
|
#import <CCLabelBMFont.h>
Public Member Functions | |
(id) | - initWithString:fntFile: |
(id) | - initWithString:fntFile:width:alignment: |
(id) | - initWithString:fntFile:width:alignment:imageOffset: |
(void) | - createFontChars |
(void) | - setWidth: |
(void) | - setAlignment: |
Static Public Member Functions | |
(void) | + purgeCachedData |
(id) | + labelWithString:fntFile: |
(id) | + labelWithString:fntFile:width:alignment: |
(id) | + labelWithString:fntFile:width:alignment:imageOffset: |
Protected Attributes | |
NSString * | _string |
NSString * | _fntFile |
NSString * | _initialString |
float | _width |
CCTextAlignment | _alignment |
CCBMFontConfiguration * | _configuration |
GLubyte | _displayedOpacity |
GLubyte | _realOpacity |
ccColor3B | _displayedColor |
ccColor3B | _realColor |
BOOL | _cascadeOpacityEnabled |
BOOL | _cascadeColorEnabled |
BOOL | _opacityModifyRGB |
CGPoint | _imageOffset |
CCSprite * | _reusedChar |
Properties | |
CCTextAlignment | alignment |
NSString * | fntFile |
GLubyte | opacity |
ccColor3B | color |
CCLabelBMFont is a subclass of CCSpriteBatchNode
Features:
Limitations:
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:
- (void) createFontChars |
updates the font chars based on the string to render
- (id) initWithString: | (NSString *) | string | |
fntFile: | (NSString *) | fntFile | |
init a BMFont label with an initial string and the FNT file
- (id) initWithString: | (NSString *) | string | |
fntFile: | (NSString *) | fntFile | |
width: | (float) | width | |
alignment: | (CCTextAlignment) | 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 | |
imageOffset: | (CGPoint) | offset | |
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) labelWithString: | (NSString *) | string | |
fntFile: | (NSString *) | fntFile | |
creates a BMFont label with an initial string and the FNT file.
+ (id) labelWithString: | (NSString *) | string | |
fntFile: | (NSString *) | fntFile | |
width: | (float) | width | |
alignment: | (CCTextAlignment) | 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 | |
imageOffset: | (CGPoint) | offset | |
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
+ (void) purgeCachedData |
Purges the cached data. Removes from memory the cached configurations and the atlas name dictionary.
- (void) setAlignment: | (CCTextAlignment) | alignment |
set label alignment
- (void) setWidth: | (float) | width |
set label width
- (CCTextAlignment) alignment [read, assign] |
alignment used for the label
conforms to CCRGBAProtocol protocol
Reimplemented from <CCRGBAProtocol>.
- (NSString*) fntFile [read, write, retain] |
fntFile used for the font
- (GLubyte) opacity [read, write, assign] |
conforms to CCRGBAProtocol protocol
Reimplemented from <CCRGBAProtocol>.