YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
Sprite.cpp
Go to the documentation of this file.
1
#include "
YAPOG/Graphics/Game/Sprite/Sprite.hpp
"
2
3
namespace
yap
4
{
5
Sprite::Sprite
()
6
:
BaseSprite
()
7
, texture_ (nullptr)
8
{
9
}
10
11
Sprite::Sprite
(
Texture
* texture)
12
:
BaseSprite
()
13
, texture_ (texture)
14
{
15
}
16
17
Sprite::Sprite
(
const
String
& textureName)
18
:
BaseSprite
()
19
, texture_ (new
Texture
(textureName))
20
{
21
}
22
23
Sprite::Sprite
(
const
String
& textureName,
const
sf::IntRect
& textureRect)
24
:
BaseSprite
()
25
, texture_ (new
Texture
(textureName, textureRect))
26
{
27
}
28
29
Sprite::~Sprite
()
30
{
31
delete
texture_
;
32
texture_
=
nullptr
;
33
}
34
35
void
Sprite::SetTexture
(
Texture
* texture)
36
{
37
texture_
= texture;
38
}
39
40
Sprite
*
Sprite::Clone
()
const
41
{
42
return
new
Sprite
(*
this
);
43
}
44
45
Sprite::Sprite
(
const
Sprite
& copy)
46
:
BaseSprite
(copy)
47
, texture_ (copy.texture_->Clone ())
48
{
49
}
50
51
Vector2
Sprite::HandleGetSize
()
const
52
{
53
return
texture_
->
GetSize
();
54
}
55
56
void
Sprite::HandleMove
(
const
Vector2
& offset)
57
{
58
texture_
->
Move
(offset);
59
}
60
61
void
Sprite::HandleScale
(
const
Vector2
& factor)
62
{
63
texture_
->
Scale
(factor);
64
}
65
66
void
Sprite::HandleDraw
(
IDrawingContext
& context)
67
{
68
texture_
->
Draw
(context);
69
}
70
71
void
Sprite::HandleShow
(
bool
isVisible)
72
{
73
}
74
75
void
Sprite::HandleChangeColor
(
const
sf::Color& color)
76
{
77
texture_
->
ChangeColor
(color);
78
}
79
80
void
Sprite::HandleUpdate
(
const
Time
& dt)
81
{
82
}
83
}
// namespace yap
YAPOG
src
YAPOG
Graphics
Game
Sprite
Sprite.cpp
Generated on Mon Sep 17 2012 22:24:25 for YAPOG by
1.8.1.1