Inherits from CCSpriteSheet : CCNode : NSObject
Conforms to CCLabelProtocol
CCRGBAProtocol
Declared in CCBitmapFontAtlas.h

Overview

CCBitmapFontAtlas is a subclass of CCSpriteSheet.

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

CCBitmapFontAtlas implements the protocol CCLabelProtocol, like CCLabel and CCLabelAtlas. CCBitmapFontAtlas has the flexibility of CCLabel, the speed of CCLabelAtlas and all the features of CCSprite. If in doubt, use CCBitmapFontAtlas instead of CCLabelAtlas / CCLabel.

Supported editors: – http://www.n4te.com/hiero/hiero.jnlp – http://slick.cokeandcode.com/demos/hiero.jnlp – http://www.angelcode.com/products/bmfont/

Tasks

Properties

color

conforms to CCRGBAProtocol protocol

@property (nonatomic, readwrite) ccColor3B color

Declared In

CCBitmapFontAtlas.h

opacity

conforms to CCRGBAProtocol protocol

@property (nonatomic, readwrite) GLubyte opacity

Declared In

CCBitmapFontAtlas.h

Class Methods

bitmapFontAtlasWithString:fntFile:

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

+ (id)bitmapFontAtlasWithString:(NSString *)string fntFile:(NSString *)fntFile

Declared In

CCBitmapFontAtlas.h

purgeCachedData

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

+ (void)purgeCachedData

Availability

Declared In

CCBitmapFontAtlas.h

Instance Methods

createFontChars

updates the font chars based on the string to render

- (void)createFontChars

Declared In

CCBitmapFontAtlas.h

initWithString:fntFile:

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

- (id)initWithString:(NSString *)string fntFile:(NSString *)fntFile

Declared In

CCBitmapFontAtlas.h