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

#include <CCLabelBMFont.h>

+ Inheritance diagram for CCLabelBMFont:
+ Collaboration diagram for CCLabelBMFont:

List of all members.

Public Member Functions

id initWithString:fntFile: (NSString *string,[fntFile] NSString *fntFile)
void createFontChars ()

Static Public Member Functions

void purgeCachedData ()
id labelWithString:fntFile: (NSString *string,[fntFile] NSString *fntFile)

Protected Attributes

NSString * string_
CCBMFontConfigurationconfiguration_
GLubyte opacity_
ccColor3B color_
BOOL opacityModifyRGB_

Properties

GLubyte opacity
ccColor3B color

Detailed Description

CCLabelBMFont is a subclass of CCSpriteBatchNode

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

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:

Since:
v0.8

Member Function Documentation

void CCLabelBMFont::createFontChars ( ) [virtual]

updates the font chars based on the string to render

id CCLabelBMFont::initWithString:fntFile: ( NSString *  string,
[fntFile] NSString *  fntFile 
) [virtual]

init a BMFont label with an initial string and the FNT file

id CCLabelBMFont::labelWithString:fntFile: ( NSString *  string,
[fntFile] NSString *  fntFile 
) [static, virtual]

creates a BMFont label with an initial string and the FNT file

void CCLabelBMFont::purgeCachedData ( ) [static, virtual]

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

Since:
v0.99.3

Property Documentation

ccColor3B CCLabelBMFont::color [read, write, assign]

conforms to CCRGBAProtocol protocol

GLubyte CCLabelBMFont::opacity [read, write, assign]

conforms to CCRGBAProtocol protocol


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