YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
Texture.hpp
Go to the documentation of this file.
1
#ifndef YAPOG_TEXTURE_HPP
2
# define YAPOG_TEXTURE_HPP
3
4
# include <SFML/Graphics/Texture.hpp>
5
# include <SFML/Graphics/Sprite.hpp>
6
# include <SFML/Graphics/Rect.hpp>
7
8
# include "
YAPOG/Macros.hpp
"
9
# include "
YAPOG/Graphics/ISpatial.hpp
"
10
# include "
YAPOG/Graphics/IDrawable.hpp
"
11
# include "
YAPOG/Game/Factory/IIDLoadable.hpp
"
12
# include "
YAPOG/System/String.hpp
"
13
# include "
YAPOG/Graphics/Vector2.hpp
"
14
# include "
YAPOG/Graphics/SpatialInfo.hpp
"
15
# include "
YAPOG/Game/ID.hpp
"
16
17
namespace
yap
18
{
21
class
YAPOG_LIB
Texture
:
public
ISpatial
22
,
public
IDrawable
23
,
public
IIDLoadable
24
{
25
DISALLOW_ASSIGN
(
Texture
);
26
27
public
:
28
29
Texture
();
30
explicit
Texture
(
const
ID
&
id
);
31
explicit
Texture
(
const
String
& name);
32
Texture
(
const
String
& name,
const
sf::IntRect
& rect);
33
virtual
~
Texture
();
34
35
void
LoadFromFile (
const
String
& name);
36
37
void
SetRect (
const
sf::IntRect
& rect);
38
39
const
ID
& GetID ()
const
;
40
void
SetID (
const
ID
&
id
);
41
44
virtual
const
Vector2
& GetPosition ()
const
;
45
virtual
const
Vector2
& GetSize ()
const
;
46
47
virtual
const
Vector2
& GetTopLeft ()
const
;
48
virtual
const
Vector2
& GetBottomRight ()
const
;
49
virtual
const
Vector2
& GetCenter ()
const
;
50
51
virtual
const
FloatRect
& GetRectangle ()
const
;
52
53
virtual
void
Move (
const
Vector2
& offset);
54
virtual
void
Scale (
const
Vector2
& factor);
55
56
virtual
void
SetPosition (
const
Vector2
& position);
57
virtual
void
SetSize (
const
Vector2
& size);
59
62
virtual
void
Draw (
IDrawingContext
& context);
63
64
virtual
bool
IsVisible ()
const
;
65
virtual
void
Show (
bool
isVisible);
66
67
virtual
void
ChangeColor (
const
sf::Color& color);
69
72
virtual
Texture
* Clone ()
const
;
74
75
protected
:
76
77
Texture
(
const
Texture
& copy);
78
79
private
:
80
81
static
const
bool
DEFAULT_VISIBLE_STATE
;
82
83
SpatialInfo
spatialInfo_
;
84
sf::Texture*
innerTexture_
;
85
sf::Sprite
sprite_
;
86
87
bool
isVisible_
;
88
89
ID
id_
;
90
};
91
}
// namespace yap
92
93
#endif // YAPOG_TEXTURE_HPP
YAPOG
include
YAPOG
Graphics
Texture.hpp
Generated on Mon Sep 17 2012 22:24:24 for YAPOG by
1.8.1.1