-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCharDef.h
51 lines (46 loc) · 1.33 KB
/
CharDef.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
49
50
51
//
// CharDef.h
// Tutorial1
//
// Created by Michael Daley on 08/03/2009.
// Copyright 2009 __MyCompanyName__. All rights reserved.
//
// Character definition which is used within the AngelCodeFont implementation.
//
// This code is based on the implementation of AngelCodeFont within Slick2D
#import <Foundation/Foundation.h>
#import "Image.h"
@interface CharDef : NSObject {
// ID of the character
int charID;
// X location on the spritesheet
int x;
// Y location on the spritesheet
int y;
// Width of the character image
int width;
// Height of the character image
int height;
// The X amount the image should be offset when drawing the image
int xOffset;
// The Y amount the image should be offset when drawing the image
int yOffset;
// The amount to move the current position after drawing the character
int xAdvance;
// The image containing the character
Image *image;
// Scale to be used when rendering the character
float scale;
}
@property(nonatomic, retain)Image *image;
@property(nonatomic)int charID;
@property(nonatomic)int x;
@property(nonatomic)int y;
@property(nonatomic)int width;
@property(nonatomic)int height;
@property(nonatomic)int xOffset;
@property(nonatomic)int yOffset;
@property(nonatomic)int xAdvance;
@property(nonatomic)float scale;
- (id)initCharDefWithFontImage:(Image*)image scale:(float)fontScale;
@end