#include <Sprite.hpp>
A Drawable specialised in displaying rectangular texture.
Definition at line 34 of file Sprite.hpp.
Public Member Functions | |
Sprite (const Texture &texture) | |
A Sprite for drawing a texture. More... | |
Sprite (const Texture &texture, const Rectangle rectangle) | |
A Sprite for drawing a part of a Texture. More... | |
Sprite (Framebuffer &framebuffer) | |
A sprite for drawing the content of a Framebuffer. More... | |
Sprite (Sprite &&)=default | |
Sprite (const Sprite &)=default | |
Sprite & | operator= (Sprite &&)=default |
Sprite & | operator= (const Sprite &)=default |
void | SetTexture (const Texture &texture) |
Update the sprite's texture. More... | |
void | SetTextureRectangle (const Rectangle &rectangle) |
Update the sprite texture area. More... | |
void | SetCenter (float center_x, float center_y) |
Set the center of the object. It is used as the rotation center. The center of the object will be drawn exactly on (0,0) on the screen (plus its potential translation if any) More... | |
void | SetCenter (const glm::vec2 ¢er) |
Set the center of the object. It is used as the rotation center. The center of the object will be drawn exactly on (0,0) on the screen (plus its potential translation if any) More... | |
void | Move (const glm::vec2 &move) |
void | Move (float x, float y) |
void | SetPosition (float x, float y) |
Set the position of the object to be drawn. More... | |
void | SetPosition (const glm::vec2 &position) |
Set the position of the object to be drawn. More... | |
void | Rotate (float rotation) |
Increase the rotation of the object to apply before drawing it. More... | |
void | SetRotation (float rotation) |
Set the rotation to apply before drawing the object. More... | |
void | SetScale (float scale) |
Increase or decrease the size of the object being drawn. More... | |
void | SetScale (const glm::vec2 &scale) |
Increase or decrease the size of the object being drawn. More... | |
void | SetScale (float scale_x, float scale_y) |
Increase or decrease the size of the object being drawn. More... | |
void | SetScaleX (float scale_x) |
Increase or decrease the size of the object being drawn. More... | |
void | SetScaleY (float scale_y) |
Increase or decrease the size of the object being drawn. More... | |
glm::mat4 | transformation () const override |
Increase or decrease the size of the object being drawn. More... | |
void | SetColor (const glm::vec4 &color) |
Color. More... | |
const glm::vec4 & | color () const |
void | SetTexture (Texture texture) |
Set the object's texture. More... | |
const Texture & | texture () const |
void | SetBlendMode (const BlendMode &) |
Set the blending mode to be used for drawing the object. More... | |
const BlendMode & | blend_mode () const |
void | SetVertexArray (VertexArray vertex_array) |
Set the object's shape. More... | |
const VertexArray & | vertex_array () const |
void | Draw (RenderTarget &target, RenderState state) const override |
smk::Sprite::Sprite | ( | const Texture & | texture | ) |
A Sprite for drawing a texture.
texture | The Texture to be displayed. |
Definition at line 16 of file Sprite.cpp.
A Sprite for drawing a part of a Texture.
texture | The Texture to be displayed. |
rectangle | A rectangle in the texture to be used. |
Definition at line 23 of file Sprite.cpp.
|
explicit |
A sprite for drawing the content of a Framebuffer.
framebuffer | The framebuffer to be used. |
Definition at line 30 of file Sprite.cpp.
|
inlineinherited |
Definition at line 36 of file Transformable.hpp.
|
inlineinherited |
Definition at line 28 of file Transformable.hpp.
|
overridevirtualinherited |
Draw the object on a RenderTarget.
target | A RenderTarget to be drawn on. |
state | The RenderState to derive from. |
Implements smk::Drawable.
Definition at line 147 of file Transformable.cpp.
|
inherited |
Increase the position of the object being drawn.
move | The increment of position (x,y) |
Definition at line 44 of file Transformable.cpp.
|
inherited |
Increase the position of the object being drawn.
x | The increment of position along the horizontal axis. |
y | The increment of position along the vertical axis. |
Definition at line 52 of file Transformable.cpp.
|
inherited |
Increase the rotation of the object to apply before drawing it.
rotation | The delta of rotation to be added. |
Definition at line 22 of file Transformable.cpp.
|
inherited |
Set the blending mode to be used for drawing the object.
blend_mode | the BlendMode to be used. |
Definition at line 133 of file Transformable.cpp.
|
inherited |
Set the center of the object. It is used as the rotation center. The center of the object will be drawn exactly on (0,0) on the screen (plus its potential translation if any)
center | The center position (x,y) in the object. |
Definition at line 60 of file Transformable.cpp.
|
inherited |
Set the center of the object. It is used as the rotation center. The center of the object will be drawn exactly on (0,0) on the screen (plus its potential translation if any)
x | The center position along the horizontal axis. |
y | The center position along the vertical axis. |
Definition at line 69 of file Transformable.cpp.
|
inherited |
Modify the color of the object. The resulting pixel is the multiplication component wise in between this color and the original pixel color.
color | The color. |
Definition at line 127 of file Transformable.cpp.
|
inherited |
Set the position of the object to be drawn.
position | the position (x,y) of the object. |
Definition at line 29 of file Transformable.cpp.
|
inherited |
Set the position of the object to be drawn.
x | The position along the horizontal axis. |
y | The position along the vertical axis. |
Definition at line 37 of file Transformable.cpp.
|
inherited |
Set the rotation to apply before drawing the object.
rotation | The angle in radian. |
Definition at line 15 of file Transformable.cpp.
|
inherited |
Increase or decrease the size of the object being drawn.
scale | The ratio of magnification. |
Definition at line 81 of file Transformable.cpp.
|
inherited |
Increase or decrease the size of the object being drawn.
scale | The ratio of magnification. |
Definition at line 75 of file Transformable.cpp.
|
inherited |
Increase or decrease the size of the object being drawn.
scale_x | The ratio of magnification along the horizontal axis. |
scale_y | The ratio of magnification along the vertical axis. |
Definition at line 88 of file Transformable.cpp.
|
inherited |
Increase or decrease the size of the object being drawn.
scale_x | The ratio of magnification along the horizontal axis. |
Definition at line 95 of file Transformable.cpp.
|
inherited |
Increase or decrease the size of the object being drawn.
scale_y | The ratio of magnification along the vertical axis. |
Definition at line 101 of file Transformable.cpp.
void smk::Sprite::SetTexture | ( | const Texture & | texture | ) |
Update the sprite's texture.
texture | The Texture to be displayed. |
Definition at line 50 of file Sprite.cpp.
|
inherited |
Set the object's texture.
Definition at line 138 of file Transformable.cpp.
void smk::Sprite::SetTextureRectangle | ( | const Rectangle & | rectangle | ) |
Update the sprite texture area.
texture | The Texture to be displayed. |
rectangle | A rectangle in the texture to be used. |
Definition at line 63 of file Sprite.cpp.
|
inherited |
Set the object's shape.
Definition at line 143 of file Transformable.cpp.
|
inlineinherited |
Definition at line 32 of file Transformable.hpp.
|
overridevirtualinherited |
Increase or decrease the size of the object being drawn.
Implements smk::TransformableBase.
Definition at line 109 of file Transformable.cpp.
|
inlineinherited |
Definition at line 40 of file Transformable.hpp.