LabelAtlas
abelAtlasIntroduction
CCLabelAtlas
was the 1st fast label added into cocos2d. But it was superseded by CCBitmapFontAtlas
.It is being maintained for backwards compatibility, but you should use CCBitmapFontAtlas
instead.
Creating a LabelAtlas
CCLabelAtlas *label = [CCLabelAtlas labelAtlasWithString:@"Hello World" charMapFile:@"tuffy_bold_italic-charmap.png" itemWidth:48 itemHeight:64 startCharMap:' '];
[self add:label];
-
charMapFile
is an image file that contains all the characters. Each character should be ordered according to its ASCII value and the image can't contain more than 256 characters. -
itemWidth
is the width of the characters in pixels -
itemHeight
is the height of the characters in pixels -
startCharMap
is the first character of the map.
http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:labels