cocos2d-iphone  1.0.1
Improved Cocos2D API Reference (iOS version) for Kobold2D developers
CCLabelAtlas Interface Reference

#include <CCLabelAtlas.h>

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

List of all members.

Public Member Functions

id initWithString:charMapFile:itemWidth:itemHeight:startCharMap: (NSString *string,[charMapFile] NSString *charmapfile,[itemWidth] NSUInteger w,[itemHeight] NSUInteger h,[startCharMap] unsigned char c)

Static Public Member Functions

id labelWithString:charMapFile:itemWidth:itemHeight:startCharMap: (NSString *string,[charMapFile] NSString *charmapfile,[itemWidth] NSUInteger w,[itemHeight] NSUInteger h,[startCharMap] unsigned char c)

Protected Attributes

NSString * string_
unsigned char 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 CCLabelAtlas::initWithString:charMapFile:itemWidth:itemHeight:startCharMap: ( NSString *  string,
[charMapFile] NSString *  charmapfile,
[itemWidth] NSUInteger  w,
[itemHeight] NSUInteger  h,
[startCharMap] unsigned char  c 
) [virtual]

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 CCLabelAtlas::labelWithString:charMapFile:itemWidth:itemHeight:startCharMap: ( NSString *  string,
[charMapFile] NSString *  charmapfile,
[itemWidth] NSUInteger  w,
[itemHeight] NSUInteger  h,
[startCharMap] unsigned char  c 
) [static, virtual]

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


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