Lums
|
A class representing a sprite. More...
#include <Sprite.hpp>
Public Member Functions | |
Sprite () | |
Texture & | texture () const |
int | width () const |
int | height () const |
std::size_t | atlas () const |
int | frame () const |
void | setTexture (Texture &texture) |
void | setAnimation (std::size_t image, std::size_t length, std::size_t speed, bool loop=true) |
void | setSpeed (std::size_t speed) |
void | setImageInAtlas (std::size_t i) |
bool | finished () const |
LUMS_EXPORTED void | update () |
Public Attributes | |
Vector2f | pos |
Vector2f | scale |
Vector4f | color |
Vector2b | flip |
A class representing a sprite.
lm::Sprite::Sprite | ( | ) |
Create a sprite
|
inline |
Get the sprite current atlas frame
|
inline |
Check if the animation has ended
|
inline |
Get the sprite frame relative to the animation
|
inline |
Get the sprite height
|
inline |
Set the frame animation
image | The base image atlas |
length | The animation length |
speed | The animation speed, in 120 frame ticks |
loop | If true, the animation loops |
|
inline |
Set the current image in atlas
i | The image index |
|
inline |
Set the animation speed
speed | The speed |
|
inline |
Set the sprite texture
texture | The texture |
|
inline |
Get the texture from the sprite.
LUMS_EXPORTED void lm::Sprite::update | ( | ) |
Update the sprite
|
inline |
Get the sprite width
Vector4f lm::Sprite::color |
The sprite color
Vector2b lm::Sprite::flip |
The sprite flip value
Vector2f lm::Sprite::pos |
The sprite position
Vector2f lm::Sprite::scale |
The sprite scale