YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
PokemonExperienceBarWidget.cpp
Go to the documentation of this file.
1
#include "
YAPOG/Graphics/Gui/WidgetBackground.hpp
"
2
#include "
YAPOG/Graphics/Gui/PictureBox.hpp
"
3
#include "
YAPOG/Graphics/Game/Sprite/Sprite.hpp
"
4
#include "
YAPOG/Graphics/Gui/HorizontalLayout.hpp
"
5
6
#include "
Gui/PokemonExperienceBarWidget.hpp
"
7
#include "Pokemon/Pokemon.hpp"
8
9
namespace
ycl
10
{
11
PokemonExperienceBarWidget::PokemonExperienceBarWidget
()
12
: experienceBarContent_ (nullptr)
13
, mainLayout_ (nullptr)
14
{
15
mainLayout_
=
new
yap::HorizontalLayout
(
16
yap::Padding
(60, 0, 0, 11),
yap::Padding
(),
false
);
17
experienceBarContent_
=
new
yap::PictureBox
();
18
}
19
20
void
PokemonExperienceBarWidget::Init
()
21
{
22
SetSize
(
yap::Vector2
(258, 26));
23
24
SetBackground
(*
new
yap::WidgetBackground
(
25
"Pictures/TeamManager/ExperienceBarContainer.png"
,
true
));
26
27
experienceBarContent_
->
SetPicture
(
new
yap::Sprite
(
28
"Pictures/TeamManager/ExperienceBarContent.png"
));
29
30
mainLayout_
->
SetSize
(
GetSize
());
31
32
mainLayout_
->
AddChild
(*
experienceBarContent_
, yap::LayoutBox::Align::TOP);
33
34
AddChild
(*
mainLayout_
);
35
}
36
37
void
PokemonExperienceBarWidget::SetPokemon
(
const
Pokemon
& pokemon)
38
{
39
experienceBarContent_
->
SetSize
(
yap::Vector2
(
40
137 * pokemon.
GetExperiencePercentage
(), 8));
41
}
42
43
bool
PokemonExperienceBarWidget::IsFocusable
()
const
44
{
45
return
false
;
46
}
47
48
void
PokemonExperienceBarWidget::HandleMove
(
const
yap::Vector2
& offset)
49
{
50
}
51
52
void
PokemonExperienceBarWidget::HandleScale
(
const
yap::Vector2
& factor)
53
{
54
}
55
void
PokemonExperienceBarWidget::HandleDraw
(
yap::IDrawingContext
& offset)
56
{
57
}
58
59
void
PokemonExperienceBarWidget::HandleShow
(
bool
isVisible)
60
{
61
}
62
63
void
PokemonExperienceBarWidget::HandleChangeColor
(
const
sf::Color& color)
64
{
65
}
66
67
void
PokemonExperienceBarWidget::HandleUpdate
(
const
yap::Time
& dt)
68
{
69
}
70
71
}
// namespace ycl
YAPOG.Client
src
Gui
PokemonExperienceBarWidget.cpp
Generated on Mon Sep 17 2012 22:24:22 for YAPOG by
1.8.1.1