TDME2
1.9.200
src
tdme
gui
renderer
GUICharacter.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
tdme/tdme.h
>
4
5
/**
6
* GUI character
7
* @author Andreas Drewke
8
*/
9
class
tdme::gui::renderer::GUICharacter
final
10
{
11
friend
class
GUIFont
;
12
13
public
:
14
/**
15
* Public constructor
16
* @param id id
17
* @param x x location on the sprite sheet
18
* @param y y location on the sprite sheet
19
* @param width width of the character image
20
* @param height height of the character image
21
* @param xOffset the amount the x position should be offset when drawing the image
22
* @param yOffset the amount the y position should be offset when drawing the image
23
* @param xAdvance the amount to move the current position after drawing the character
24
*/
25
inline
GUICharacter
(
26
uint32_t
id
,
27
float
x
,
28
float
y
,
29
float
width
,
30
float
height
,
31
float
xOffset
,
32
float
yOffset
,
33
float
xAdvance
34
):
35
id
(
id
),
36
x
(
x
),
37
y
(
y
),
38
width
(
width
),
39
height
(
height
),
40
xOffset
(
xOffset
),
41
yOffset
(
yOffset
),
42
xAdvance
(
xAdvance
)
43
{
44
//
45
}
46
47
/**
48
* @return id
49
*/
50
uint32_t
getId
() {
51
return
id
;
52
}
53
54
/**
55
* @return x location on the sprite sheet
56
*/
57
float
getX
() {
58
return
x
;
59
}
60
61
/**
62
* @return y location on the sprite sheet
63
*/
64
float
getY
() {
65
return
y
;
66
}
67
68
/**
69
* @return width of the character image
70
*/
71
float
getWidth
() {
72
return
width
;
73
}
74
75
/**
76
* @return height of the character image
77
*/
78
float
getHeight
() {
79
return
height
;
80
}
81
82
/**
83
* @return the amount the x position should be offset when drawing the image
84
*/
85
float
getXOffset
() {
86
return
xOffset
;
87
}
88
89
/**
90
* @return the amount the y position should be offset when drawing the image
91
*/
92
float
getYOffset
() {
93
return
yOffset
;
94
}
95
96
/**
97
* @return the amount to move the current position after drawing the character
98
*/
99
float
getXAdvance
() {
100
return
xAdvance
;
101
}
102
103
/**
104
* @return if the character is rotated in texture atlas
105
*/
106
bool
isRotated
() {
107
return
rotated
;
108
}
109
110
private
:
111
uint32_t
id
;
112
float
x
;
113
float
y
;
114
float
width
;
115
float
height
;
116
float
xOffset
;
117
float
yOffset
;
118
float
xAdvance
;
119
bool
rotated
{
false
};
120
};
tdme::gui::renderer::GUICharacter
GUI character.
Definition:
GUICharacter.h:10
tdme::gui::renderer::GUICharacter::getId
uint32_t getId()
Definition:
GUICharacter.h:50
tdme::gui::renderer::GUICharacter::getYOffset
float getYOffset()
Definition:
GUICharacter.h:92
tdme::gui::renderer::GUICharacter::GUICharacter
GUICharacter(uint32_t id, float x, float y, float width, float height, float xOffset, float yOffset, float xAdvance)
Public constructor.
Definition:
GUICharacter.h:25
tdme::gui::renderer::GUICharacter::getXOffset
float getXOffset()
Definition:
GUICharacter.h:85
tdme::gui::renderer::GUICharacter::getHeight
float getHeight()
Definition:
GUICharacter.h:78
tdme::gui::renderer::GUICharacter::height
float height
Definition:
GUICharacter.h:115
tdme::gui::renderer::GUICharacter::xOffset
float xOffset
Definition:
GUICharacter.h:116
tdme::gui::renderer::GUICharacter::isRotated
bool isRotated()
Definition:
GUICharacter.h:106
tdme::gui::renderer::GUICharacter::yOffset
float yOffset
Definition:
GUICharacter.h:117
tdme::gui::renderer::GUICharacter::xAdvance
float xAdvance
Definition:
GUICharacter.h:118
tdme::gui::renderer::GUICharacter::getXAdvance
float getXAdvance()
Definition:
GUICharacter.h:99
tdme::gui::renderer::GUICharacter::rotated
bool rotated
Definition:
GUICharacter.h:119
tdme::gui::renderer::GUICharacter::getY
float getY()
Definition:
GUICharacter.h:64
tdme::gui::renderer::GUICharacter::y
float y
Definition:
GUICharacter.h:113
tdme::gui::renderer::GUICharacter::id
uint32_t id
Definition:
GUICharacter.h:111
tdme::gui::renderer::GUICharacter::getWidth
float getWidth()
Definition:
GUICharacter.h:71
tdme::gui::renderer::GUICharacter::x
float x
Definition:
GUICharacter.h:112
tdme::gui::renderer::GUICharacter::width
float width
Definition:
GUICharacter.h:114
tdme::gui::renderer::GUICharacter::getX
float getX()
Definition:
GUICharacter.h:57
tdme::gui::renderer::GUIFont
GUI font class.
Definition:
GUIFont.h:41
tdme.h
Generated by
1.9.1