cocos2d-iphone  2.1
Improved Cocos2D API Reference (iOS version) for www.kobold2d.com developers
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Defines
CCLabelAtlas Class Reference

#import <CCLabelAtlas.h>

+ Inheritance diagram for CCLabelAtlas:
+ Collaboration diagram for CCLabelAtlas:

List of all members.

Public Member Functions

(id) - initWithString:charMapFile:itemWidth:itemHeight:startCharMap:
(id) - initWithString:texture:itemWidth:itemHeight:startCharMap:
(id) - initWithString:fntFile:

Static Public Member Functions

(id) + labelWithString:charMapFile:itemWidth:itemHeight:startCharMap:
(id) + labelWithString:fntFile:

Protected Attributes

NSString * _string
NSUInteger _mapStartChar

Detailed Description

CCLabelAtlas is a subclass of CCAtlasNode.

It can be as a replacement of CCLabel since it is MUCH faster.

CCLabelAtlas versus CCLabel:

  • CCLabelAtlas is MUCH faster than CCLabel
  • CCLabelAtlas "characters" have a fixed height and width
  • CCLabelAtlas "characters" can be anything you want since they are taken from an image file

A more flexible class is CCLabelBMFont. It supports variable width characters and it also has a nice editor.


Member Function Documentation

- (id) initWithString: (NSString *)  string
charMapFile: (NSString *)  charmapfile
itemWidth: (NSUInteger)  w
itemHeight: (NSUInteger)  h
startCharMap: (NSUInteger)  firstElement 

initializes the CCLabelAtlas with a string, a char map file(the atlas), the width and height in points of each element and the starting char of the atlas

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

initializes the CCLabelAtlas with a string and a configuration file

Since:
v2.0
- (id) initWithString: (NSString *)  theString
texture: (CCTexture2D *)  texture
itemWidth: (NSUInteger)  w
itemHeight: (NSUInteger)  h
startCharMap: (NSUInteger)  c 

initializes the CCLabelAtlas with a string, a texture, the width and height in points of each element and the starting char of the atlas

+ (id) labelWithString: (NSString *)  string
charMapFile: (NSString *)  charmapfile
itemWidth: (NSUInteger)  w
itemHeight: (NSUInteger)  h
startCharMap: (NSUInteger)  firstElement 

creates the CCLabelAtlas with a string, a char map file(the atlas), the width and height of each element in points and the starting char of the atlas

+ (id) labelWithString: (NSString *)  string
fntFile: (NSString *)  fontFile 

creates the CCLabelAtlas with a string and a configuration file

Since:
v2.0

The documentation for this class was generated from the following file: