forked from monoclestudios/simplegame
/
Label.h
48 lines (40 loc) · 1.64 KB
/
Label.h
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
48
/* cocos2d for iPhone
*
* http://code.google.com/p/cocos2d-iphone
*
* Copyright (C) 2008,2009 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 <UIKit/UIKit.h>
#import "Support/Texture2D.h"
#import "TextureNode.h"
/** Label is a subclass of TextureNode that knows how to render text labels
*
* All features from TextureNode are valid in Label
*/
@interface Label : TextureNode
{
CGSize _dimensions;
UITextAlignment _alignment;
NSString * _fontName;
CGFloat _fontSize;
}
/** creates a label 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 label from a fontname and font size */
+ (id) labelWithString:(NSString*)string fontName:(NSString*)name fontSize:(CGFloat)size;
/** initializes the label 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 label 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 Label. To obtain better performance use LabelAtlas
*/
- (void) setString:(NSString*)string;
@end