Inherits from CCSprite : CCNodeRGBA : CCNode : NSObject
Conforms to CCLabelProtocol
Declared in CCLabel.h

Overview

CCLabel is a subclass of CCTextureNode that knows how to render text labels

All features from CCTextureNode are valid in CCLabel

CCLabel objects are slow. Consider using CCLabelAtlas or CCBitmapFontAtlas instead.

Tasks

Class Methods

labelWithString:dimensions:alignment:fontName:fontSize:

creates a CCLabel from a fontname, alignment, dimension and font size

+ (id)labelWithString:(NSString *)string dimensions:(CGSize)dimensions alignment:(UITextAlignment)alignment fontName:(NSString *)name fontSize:(CGFloat)size

Declared In

CCLabel.h

labelWithString:fontName:fontSize:

creates a CCLabel from a fontname and font size

+ (id)labelWithString:(NSString *)string fontName:(NSString *)name fontSize:(CGFloat)size

Declared In

CCLabel.h

Instance Methods

initWithString:dimensions:alignment:fontName:fontSize:

initializes the CCLabel with a font name, alignment, dimension and font size

- (id)initWithString:(NSString *)string dimensions:(CGSize)dimensions alignment:(UITextAlignment)alignment fontName:(NSString *)name fontSize:(CGFloat)size

Declared In

CCLabel.h

initWithString:fontName:fontSize:

initializes the CCLabel with a font name and font size

- (id)initWithString:(NSString *)string fontName:(NSString *)name fontSize:(CGFloat)size

Declared In

CCLabel.h

setString:

changes the string to render

- (void)setString:(NSString *)str

Discussion

Warning: Changing the string is as expensive as creating a new CCLabel. To obtain better performance use CCLabelAtlas

Declared In

CCLabel.h