Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated CCLabelBMFont documentation

  • Loading branch information...
commit e48f407ada01b56ecb1b6726deae004ac850df1c 1 parent f09a3b3
@ricardoquesada ricardoquesada authored
View
2  cocos2d/CCDirector.h
@@ -283,7 +283,7 @@ and when to execute the Scenes.
// Memory Helper
/** Removes all the cocos2d data that was cached automatically.
- It will purge the CCTextureCache, CCBitmapFont cache.
+ It will purge the CCTextureCache, CCLabelBMFont cache.
IMPORTANT: The CCSpriteFrameCache won't be purged. If you want to purge it, you have to purge it manually.
@since v0.99.3
*/
View
2  cocos2d/CCLabelAtlas.h
@@ -37,7 +37,7 @@
- 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 CCBitmapFontAtlas. It supports variable width characters and it also has a nice editor.
+ A more flexible class is CCLabelBMFont. It supports variable width characters and it also has a nice editor.
*/
@interface CCLabelAtlas : CCAtlasNode <CCLabelProtocol>
{
View
12 cocos2d/CCLabelBMFont.h
@@ -25,12 +25,12 @@
* Portions of this code are based and inspired on:
* http://www.71squared.co.uk/2009/04/iphone-game-programming-tutorial-4-bitmap-font-class
* by Michael Daley
-
- * Use any of these editors to generate bitmap font atlas:
- * http://www.n4te.com/hiero/hiero.jnlp
- * http://slick.cokeandcode.com/demos/hiero.jnlp
- * http://www.angelcode.com/products/bmfont/
- *
+ *
+ * Use any of these editors to generate BMFonts:
+ * http://glyphdesigner.71squared.com/ (Commercial, Mac OS X)
+ * http://www.n4te.com/hiero/hiero.jnlp (Free, Java)
+ * http://slick.cokeandcode.com/demos/hiero.jnlp (Free, Java)
+ * http://www.angelcode.com/products/bmfont/ (Free, Windows only)
*/
#import "CCSpriteBatchNode.h"
View
31 cocos2d/CCLabelBMFont.m
@@ -27,10 +27,11 @@
* by Michael Daley
*
*
- * Use any of these editors to generate bitmap font atlas:
- * http://www.n4te.com/hiero/hiero.jnlp
- * http://slick.cokeandcode.com/demos/hiero.jnlp
- * http://www.angelcode.com/products/bmfont/
+ * Use any of these editors to generate BMFonts:
+ * http://glyphdesigner.71squared.com/ (Commercial, Mac OS X)
+ * http://www.n4te.com/hiero/hiero.jnlp (Free, Java)
+ * http://slick.cokeandcode.com/demos/hiero.jnlp (Free, Java)
+ * http://www.angelcode.com/products/bmfont/ (Free, Windows only)
*/
#import "ccConfig.h"
@@ -207,13 +208,13 @@ -(void) parseImageFileName:(NSString*)line fntFile:(NSString*)fntFile
// page ID. Sanity check
propertyValue = [nse nextObject];
- NSAssert( [propertyValue intValue] == 0, @"XXX: BitmapFontAtlas only supports 1 page");
+ NSAssert( [propertyValue intValue] == 0, @"XXX: LabelBMFont only supports 1 page");
// file
propertyValue = [nse nextObject];
NSArray *array = [propertyValue componentsSeparatedByString:@"\""];
propertyValue = [array objectAtIndex:1];
- NSAssert(propertyValue,@"BitmapFontAtlas file could not be found");
+ NSAssert(propertyValue,@"LabelBMFont file could not be found");
// Supports subdirectories
NSString *dir = [fntFile stringByDeletingLastPathComponent];
@@ -431,13 +432,13 @@ @implementation CCLabelBMFont
@synthesize opacity = opacity_, color = color_;
-#pragma mark BitmapFontAtlas - Purge Cache
+#pragma mark LabelBMFont - Purge Cache
+(void) purgeCachedData
{
FNTConfigRemoveCache();
}
-#pragma mark BitmapFontAtlas - Creation & Init
+#pragma mark LabelBMFont - Creation & Init
+(id) labelWithString:(NSString *)string fntFile:(NSString *)fntFile
{
@@ -458,7 +459,7 @@ -(id) initWithString:(NSString*)theString fntFile:(NSString*)fntFile
configuration_ = FNTConfigLoadFile(fntFile);
[configuration_ retain];
- NSAssert( configuration_, @"Error creating config for BitmapFontAtlas");
+ NSAssert( configuration_, @"Error creating config for LabelBMFont");
if ((self=[super initWithFile:configuration_->atlasName_ capacity:[theString length]])) {
@@ -485,7 +486,7 @@ -(void) dealloc
[super dealloc];
}
-#pragma mark BitmapFontAtlas - Atlas generation
+#pragma mark LabelBMFont - Atlas generation
-(int) kerningAmountForFirst:(unichar)first second:(unichar)second
{
@@ -533,7 +534,7 @@ -(void) createFontChars
for(NSUInteger i=0; i<stringLen; i++) {
unichar c = [string_ characterAtIndex:i];
- NSAssert( c < kCCBMFontMaxChars, @"BitmapFontAtlas: character outside bounds");
+ NSAssert( c < kCCBMFontMaxChars, @"LabelBMFont: character outside bounds");
if (c == '\n') {
nextFontPositionX = 0;
@@ -592,7 +593,7 @@ -(void) createFontChars
[self setContentSizeInPixels:tmpSize];
}
-#pragma mark BitmapFontAtlas - CCLabelProtocol protocol
+#pragma mark LabelBMFont - CCLabelProtocol protocol
- (void) setString:(NSString*) newString
{
[string_ release];
@@ -615,7 +616,7 @@ -(void) setCString:(char*)label
[self setString:[NSString stringWithUTF8String:label]];
}
-#pragma mark BitmapFontAtlas - CCRGBAProtocol protocol
+#pragma mark LabelBMFont - CCRGBAProtocol protocol
-(void) setColor:(ccColor3B)color
{
@@ -648,7 +649,7 @@ -(BOOL) doesOpacityModifyRGB
return opacityModifyRGB_;
}
-#pragma mark BitmapFontAtlas - AnchorPoint
+#pragma mark LabelBMFont - AnchorPoint
-(void) setAnchorPoint:(CGPoint)point
{
if( ! CGPointEqualToPoint(point, anchorPoint_) ) {
@@ -657,7 +658,7 @@ -(void) setAnchorPoint:(CGPoint)point
}
}
-#pragma mark BitmapFontAtlas - Debug draw
+#pragma mark LabelBMFont - Debug draw
#if CC_LABELBMFONT_DEBUG_DRAW
-(void) draw
{
View
2  cocos2d/CCLabelTTF.h
@@ -34,7 +34,7 @@
*
* All features from CCTextureNode are valid in CCLabel
*
- * CCLabel objects are slow. Consider using CCLabelAtlas or CCBitmapFontAtlas instead.
+ * CCLabel objects are slow. Consider using CCLabelAtlas or CCLabelBMFont instead.
*/
@interface CCLabelTTF : CCSprite <CCLabelProtocol>
View
2  cocos2d/CCTMXLayer.m
@@ -51,7 +51,7 @@ @implementation CCSpriteBatchNode (TMXTiledMapExtension)
/* Adds a quad into the texture atlas but it won't be added into the children array.
This method should be called only when you are dealing with very big AtlasSrite and when most of the CCSprite won't be updated.
- For example: a tile map (CCTMXMap) or a label with lots of characgers (BitmapFontAtlas)
+ For example: a tile map (CCTMXMap) or a label with lots of characgers (CCLabelBMFont)
*/
-(void) addQuadFromSprite:(CCSprite*)sprite quadIndex:(NSUInteger)index
{
View
2  cocos2d/ccConfig.h
@@ -42,7 +42,7 @@
The "correct" way to prevent artifacts is by using the spritesheet-artifact-fixer.py or a similar tool.
Affected nodes:
- - CCSprite / CCSpriteBatchNode and subclasses: CCBitmapFontAtlas, CCTMXTiledMap
+ - CCSprite / CCSpriteBatchNode and subclasses: CCLabelBMFont, CCTMXTiledMap
- CCLabelAtlas
- CCQuadParticleSystem
- CCTileMap
View
65 tests/LabelTest.m
@@ -348,10 +348,11 @@ -(NSString *) subtitle
#pragma mark Example Atlas3
/*
- * Use any of these editors to generate BMFont labels:
- * http://www.n4te.com/hiero/hiero.jnlp
- * http://slick.cokeandcode.com/demos/hiero.jnlp
- * http://www.angelcode.com/products/bmfont/
+ * Use any of these editors to generate BMFonts:
+ * http://glyphdesigner.71squared.com/ (Commercial, Mac OS X)
+ * http://www.n4te.com/hiero/hiero.jnlp (Free, Java)
+ * http://slick.cokeandcode.com/demos/hiero.jnlp (Free, Java)
+ * http://www.angelcode.com/products/bmfont/ (Free, Windows only)
*/
@implementation Atlas3
-(id) init
@@ -431,10 +432,11 @@ -(NSString *) subtitle
#pragma mark Example Atlas4
/*
- * Use any of these editors to generate BMFont labels:
- * http://www.n4te.com/hiero/hiero.jnlp
- * http://slick.cokeandcode.com/demos/hiero.jnlp
- * http://www.angelcode.com/products/bmfont/
+ * Use any of these editors to generate BMFonts:
+ * http://glyphdesigner.71squared.com/ (Commercial, Mac OS X)
+ * http://www.n4te.com/hiero/hiero.jnlp (Free, Java)
+ * http://slick.cokeandcode.com/demos/hiero.jnlp (Free, Java)
+ * http://www.angelcode.com/products/bmfont/ (Free, Windows only)
*/
@implementation Atlas4
@@ -525,10 +527,11 @@ -(NSString *) subtitle
#pragma mark Example Atlas5
/*
- * Use any of these editors to generate BMFont labels:
- * http://www.n4te.com/hiero/hiero.jnlp
- * http://slick.cokeandcode.com/demos/hiero.jnlp
- * http://www.angelcode.com/products/bmfont/
+ * Use any of these editors to generate BMFonts:
+ * http://glyphdesigner.71squared.com/ (Commercial, Mac OS X)
+ * http://www.n4te.com/hiero/hiero.jnlp (Free, Java)
+ * http://slick.cokeandcode.com/demos/hiero.jnlp (Free, Java)
+ * http://www.angelcode.com/products/bmfont/ (Free, Windows only)
*/
@implementation Atlas5
@@ -564,10 +567,11 @@ -(NSString *) subtitle
#pragma mark Example Atlas6
/*
- * Use any of these editors to generate BMFont label:
- * http://www.n4te.com/hiero/hiero.jnlp
- * http://slick.cokeandcode.com/demos/hiero.jnlp
- * http://www.angelcode.com/products/bmfont/
+ * Use any of these editors to generate BMFonts:
+ * http://glyphdesigner.71squared.com/ (Commercial, Mac OS X)
+ * http://www.n4te.com/hiero/hiero.jnlp (Free, Java)
+ * http://slick.cokeandcode.com/demos/hiero.jnlp (Free, Java)
+ * http://www.angelcode.com/products/bmfont/ (Free, Windows only)
*/
@implementation Atlas6
@@ -614,10 +618,11 @@ -(NSString *) subtitle
#pragma mark Example AtlasBitmapColor
/*
- * Use any of these editors to generate BMFont label:
- * http://www.n4te.com/hiero/hiero.jnlp
- * http://slick.cokeandcode.com/demos/hiero.jnlp
- * http://www.angelcode.com/products/bmfont/
+ * Use any of these editors to generate BMFonts:
+ * http://glyphdesigner.71squared.com/ (Commercial, Mac OS X)
+ * http://www.n4te.com/hiero/hiero.jnlp (Free, Java)
+ * http://slick.cokeandcode.com/demos/hiero.jnlp (Free, Java)
+ * http://www.angelcode.com/products/bmfont/ (Free, Windows only)
*/
@implementation AtlasBitmapColor
@@ -668,10 +673,11 @@ -(NSString *) subtitle
#pragma mark Example AtlasFastBitmap
/*
- * Use any of these editors to generate BMFont label:
- * http://www.n4te.com/hiero/hiero.jnlp
- * http://slick.cokeandcode.com/demos/hiero.jnlp
- * http://www.angelcode.com/products/bmfont/
+ * Use any of these editors to generate BMFonts:
+ * http://glyphdesigner.71squared.com/ (Commercial, Mac OS X)
+ * http://www.n4te.com/hiero/hiero.jnlp (Free, Java)
+ * http://slick.cokeandcode.com/demos/hiero.jnlp (Free, Java)
+ * http://www.angelcode.com/products/bmfont/ (Free, Windows only)
*/
@implementation AtlasFastBitmap
@@ -711,10 +717,11 @@ -(NSString *) subtitle
#pragma mark BitmapFontMultiLine
/*
- * Use any of these editors to generate BMFont label:
- * http://www.n4te.com/hiero/hiero.jnlp
- * http://slick.cokeandcode.com/demos/hiero.jnlp
- * http://www.angelcode.com/products/bmfont/
+ * Use any of these editors to generate BMFonts:
+ * http://glyphdesigner.71squared.com/ (Commercial, Mac OS X)
+ * http://www.n4te.com/hiero/hiero.jnlp (Free, Java)
+ * http://slick.cokeandcode.com/demos/hiero.jnlp (Free, Java)
+ * http://www.angelcode.com/products/bmfont/ (Free, Windows only)
*/
@implementation BitmapFontMultiLine
@@ -840,7 +847,7 @@ -(NSString*) title
-(NSString *) subtitle
{
- return @"3 empty labels: LabelAtlas, Label and BitmapFontAtlas";
+ return @"3 empty labels: LabelAtlas, LabelTTF and LabelBMFont";
}
@end
View
2  tests/MenuTest.m
@@ -47,7 +47,7 @@ -(id) init
// Font Item
CCMenuItem *item4 = [CCMenuItemFont itemFromString: @"I toggle enable items" target: self selector:@selector(menuCallbackEnable:)];
- // Label Item (BitmapFontAtlas)
+ // Label Item (CCLabelBMFont)
CCLabelBMFont *label = [CCLabelBMFont labelWithString:@"configuration" fntFile:@"bitmapFontTest3.fnt"];
CCMenuItemLabel *item5 = [CCMenuItemLabel itemWithLabel:label target:self selector:@selector(menuCallbackConfig:)];
Please sign in to comment.
Something went wrong with that request. Please try again.