Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 8ff70902d0
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 48 lines (41 sloc) 1.767 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
/* cocos2d for iPhone
*
* http://www.cocos2d-iphone.org
*
* Copyright (C) 2008,2009,2010 Ricardo Quesada
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the 'cocos2d for iPhone' license.
*
* You will find a copy of this license within the cocos2d for iPhone
* distribution inside the "LICENSE" file.
*
*/


#import "CCTexture2D.h"
#import "CCSprite.h"

/** CCLabel is a subclass of CCTextureNode that knows how to render text labels
*
* All features from CCTextureNode are valid in CCLabel
*
* CCLabel objects are slow. Consider using CCLabelAtlas or CCBitmapFontAtlas instead.
*/
@interface CCLabel : CCSprite <CCLabelProtocol>
{
CGSize dimensions_;
UITextAlignment alignment_;
NSString * fontName_;
CGFloat fontSize_;
}

/** creates a CCLabel from a fontname, alignment, dimension and font size */
+ (id) labelWithString:(NSString*)string dimensions:(CGSize)dimensions alignment:(UITextAlignment)alignment fontName:(NSString*)name fontSize:(CGFloat)size;
/** creates a CCLabel from a fontname and font size */
+ (id) labelWithString:(NSString*)string fontName:(NSString*)name fontSize:(CGFloat)size;
/** initializes the CCLabel with a font name, alignment, dimension and font size */
- (id) initWithString:(NSString*)string dimensions:(CGSize)dimensions alignment:(UITextAlignment)alignment fontName:(NSString*)name fontSize:(CGFloat)size;
/** initializes the CCLabel with a font name and font size */
- (id) initWithString:(NSString*)string fontName:(NSString*)name fontSize:(CGFloat)size;

/** changes the string to render
* @warning Changing the string is as expensive as creating a new CCLabel. To obtain better performance use CCLabelAtlas
*/
- (void) setString:(NSString*)string;

@end
Something went wrong with that request. Please try again.