PageRenderTime 21ms CodeModel.GetById 19ms app.highlight 1ms RepoModel.GetById 0ms app.codeStats 0ms

/libs/cocos2d/CCLabelAtlas.h

http://github.com/kstenerud/ObjectAL-for-iPhone
C Header | 55 lines | 9 code | 7 blank | 39 comment | 0 complexity | 39c09399a23ccc22ce1e7ddac679f148 MD5 | raw file
Possible License(s): Apache-2.0
 1/*
 2 * cocos2d for iPhone: http://www.cocos2d-iphone.org
 3 *
 4 * Copyright (c) 2008-2010 Ricardo Quesada
 5 * 
 6 * Permission is hereby granted, free of charge, to any person obtaining a copy
 7 * of this software and associated documentation files (the "Software"), to deal
 8 * in the Software without restriction, including without limitation the rights
 9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 * 
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 * 
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE.
23 *
24 */
25
26
27#import "CCAtlasNode.h"
28#import "CCTextureAtlas.h"
29
30/** CCLabelAtlas is a subclass of CCAtlasNode.
31 
32 It can be as a replacement of CCLabel since it is MUCH faster.
33 
34 CCLabelAtlas versus CCLabel:
35 - CCLabelAtlas is MUCH faster than CCLabel
36 - CCLabelAtlas "characters" have a fixed height and width
37 - CCLabelAtlas "characters" can be anything you want since they are taken from an image file
38 
39 A more flexible class is CCBitmapFontAtlas. It supports variable width characters and it also has a nice editor.
40 */
41@interface CCLabelAtlas : CCAtlasNode  <CCLabelProtocol> {
42		
43	// string to render
44	NSString		*string_;
45	
46	// the first char in the charmap
47	char			mapStartChar;
48}
49
50/** creates the CCLabelAtlas with a string, a char map file(the atlas), the width and height of each element and the starting char of the atlas */
51+(id) labelAtlasWithString:(NSString*) string charMapFile: (NSString*) charmapfile itemWidth:(int)w itemHeight:(int)h startCharMap:(char)c;
52
53/** initializes the CCLabelAtlas with a string, a char map file(the atlas), the width and height of each element and the starting char of the atlas */
54-(id) initWithString:(NSString*) string charMapFile: (NSString*) charmapfile itemWidth:(int)w itemHeight:(int)h startCharMap:(char)c;
55@end