YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
PokemonBattleInfoWidget.cpp
Go to the documentation of this file.
1
#include "
YAPOG/Graphics/Gui/PictureBox.hpp
"
2
#include "
YAPOG/Graphics/Gui/WidgetBackground.hpp
"
3
#include "
YAPOG/Game/Pokemon/HitPoint.hpp
"
4
#include "
YAPOG/System/StringHelper.hpp
"
5
6
#include "
Battle/PokemonBattleInfoWidget.hpp
"
7
8
namespace
ycl
9
{
10
PokemonBattleInfoWidget::PokemonBattleInfoWidget
()
11
:
BattleInfoWidget
(yap::Padding (40, 30, 0, 0))
12
, hpValue_ ()
13
, experienceBar_ ()
14
{
15
}
16
17
void
PokemonBattleInfoWidget::Init
()
18
{
19
// Set background
20
yap::WidgetBackground
* background =
21
new
yap::WidgetBackground
(
22
"Pictures/Battle/PokemonInfoBackground.png"
,
true
);
23
background->
SetFixed
(
true
);
24
battleInfoBox_
.
SetBackground
(*background);
25
26
BattleInfoWidget::Init
();
27
28
hpValue_
.
ChangeColor
(sf::Color::Black);
29
battleInfoBox_
.
AddChild
(
hpValue_
, yap::LayoutBox::Align::RIGHT);
30
}
31
32
void
PokemonBattleInfoWidget::SetHPValue
(
const
yap::HitPoint
& hp)
33
{
34
hpValue_
.
SetText
(
35
yap::StringHelper::ToString
(hp.
GetCurrentValue
()) +
36
" / "
+
37
yap::StringHelper::ToString
(hp.
GetValue
()));
38
39
battleInfoBox_
.
Refresh
();
40
}
41
}
YAPOG.Client
src
Battle
PokemonBattleInfoWidget.cpp
Generated on Mon Sep 17 2012 22:24:21 for YAPOG by
1.8.1.1