Mercurial > LightClone
annotate LightClone/Source/GuiLabel.h @ 17:4951acfe92fc
Reworking GUI system
author | koryspansel <koryspansel@bendbroadband.com> |
---|---|
date | Wed, 14 Sep 2011 13:33:22 -0700 |
parents | |
children | 33cb6979ac51 |
rev | line source |
---|---|
17
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
1 /* |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
2 * GuiLabel |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
3 */ |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
4 |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
5 #ifndef __GUILABEL_H__ |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
6 #define __GUILABEL_H__ |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
7 |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
8 #include "Core.h" |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
9 #include "GuiElement.h" |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
10 |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
11 /* |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
12 * GuiLabelFlag |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
13 */ |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
14 enum |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
15 { |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
16 GuiLabelFlag_CenterX = (1 << 0), |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
17 GuiLabelFlag_CenterY = (1 << 1), |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
18 }; |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
19 |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
20 /* |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
21 * GuiLabel |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
22 */ |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
23 class GuiLabel : public GuiElement |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
24 { |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
25 /* |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
26 * MaximumLabelLength |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
27 */ |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
28 static const uint32 MaximumLabelLength = 32; |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
29 |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
30 /* |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
31 * pResourceManager |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
32 */ |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
33 ResourceManager* pResourceManager; |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
34 |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
35 /* |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
36 * pFont |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
37 */ |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
38 ID3DXFont* pFont; |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
39 |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
40 /* |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
41 * kLabel |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
42 */ |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
43 char kLabel[MaximumLabelLength]; |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
44 |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
45 /* |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
46 * nFlags |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
47 */ |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
48 uint32 nFlags; |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
49 |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
50 /* |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
51 * kColor |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
52 */ |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
53 D3DCOLOR kColor; |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
54 |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
55 public: |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
56 |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
57 /* |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
58 * GuiLabel |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
59 */ |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
60 GuiLabel(); |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
61 |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
62 /* |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
63 * Initialize |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
64 */ |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
65 virtual ErrorCode Initialize(ResourceManager* pResourceManager); |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
66 |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
67 /* |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
68 * Terminate |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
69 */ |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
70 virtual void Terminate(); |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
71 |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
72 /* |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
73 * Update |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
74 */ |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
75 virtual void Update(float fElapsed); |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
76 |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
77 /* |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
78 * Render |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
79 */ |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
80 virtual void Render(RenderContext& kContext); |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
81 |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
82 /* |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
83 * SetFont |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
84 */ |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
85 ErrorCode SetFont(const char* pName, uint32 nSize, uint32 nHeight = FW_NORMAL); |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
86 |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
87 /* |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
88 * SetText |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
89 */ |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
90 ErrorCode SetText(const char* pText); |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
91 }; |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
92 |
4951acfe92fc
Reworking GUI system
koryspansel <koryspansel@bendbroadband.com>
parents:
diff
changeset
|
93 #endif //__GUILABEL_H__ |