Castle Battle  1.0
hud.h
Go to the documentation of this file.
1 #ifndef HUD_H
2 #define HUD_H
3 #include <irrlicht.h>
4 #include <iostream>
5 using namespace irr;
7 namespace HUD{
8 
9  enum{
13  };
14 
15  const f32 SPEED_HIGH = 1.0098f;
16  const f32 SPEED_LOW = 0.975f;
17  const s32 MAX_HEIGHT = 237;
19  class HUD{
20  private:
22  gui::IGUISkin* skin;
24  IrrlichtDevice* device;
26  gui::IGUIFont* font;
28  gui::IGUIStaticText* playerName;
30  gui::IGUIStaticText* powertext;
32  gui::IGUIImage* power;
34  core::rect<s32> power_rect;
36  video::IVideoDriver* driver;
38  f32 velocity = SPEED_LOW;
43  core::rect<s32> initialPosPower;
44  void initHUD();
45 
46  public:
48  gui::IGUIEnvironment* env;
52  HUD(IrrlichtDevice* device, video::IVideoDriver* video);
54  void animatePower();
56  f32 getPower();
58  void setPlayerName(core::stringw name);
60  void resetPower();
61 
62 
63 
64  };
65 };
66 #endif
f32 powerRatio
Percentage of power respect to the total area.
Definition: hud.h:40
gui::IGUIStaticText * powertext
Power text below bar.
Definition: hud.h:30
POWER_TEXT not used.
Definition: hud.h:11
IrrlichtDevice * device
Irrlicht device.
Definition: hud.h:24
gui::IGUIEnvironment * env
Irrlicht GUI Enviroment.
Definition: hud.h:48
gui::IGUIImage * power
Image power bar.
Definition: hud.h:32
POWER_BAR is power shot bar.
Definition: hud.h:12
gui::IGUIFont * font
Font.
Definition: hud.h:26
const f32 SPEED_LOW
Definition: hud.h:16
core::rect< s32 > power_rect
Clipping power rectangle.
Definition: hud.h:34
gui::IGUISkin * skin
Gui skin.
Definition: hud.h:22
Graphic user interface namespace.
Definition: hud.cpp:6
Definition: hud.h:10
gui::IGUIStaticText * playerName
Player name.
Definition: hud.h:28
const f32 SPEED_HIGH
Definition: hud.h:15
core::rect< s32 > initialPosPower
Private.
Definition: hud.h:43
video::IVideoDriver * driver
Irrlicht video driver instance.
Definition: hud.h:36
const s32 MAX_HEIGHT
Definition: hud.h:17