hx3d
1
2D/3D Simple Game Framework
|
Animated texture-atlas based sprite. More...
#include <animation.hpp>
Public Member Functions | |
Animation () | |
Create an uninitialized animation. More... | |
Animation (Ptr< TextureAtlas > atlas, std::vector< std::string > frames, float speed) | |
Create an animation with an atlas, frames and a speed. More... | |
void | initialize (Ptr< TextureAtlas > atlas, std::vector< std::string > frames, float speed) |
Initialize an animation with an atlas, frames and a speed. More... | |
void | update (float delta) |
Update the animation. More... | |
![]() | |
Sprite () | |
Create a sprite without texture. More... | |
void | setTexture (const Ptr< Texture > &texture) |
Set the sprite texture. More... | |
void | setTexture (Framebuffer &buffer) |
Set the sprite texture from a framebuffer color buffer. More... | |
void | setTexture (TextureRegion ®ion) |
Set the sprite texture from a texture region. More... | |
Ptr< Texture > | getTexture () |
Get the sprite texture. More... | |
void | scaleTexture () |
Scale the texture coordinates following the texture size. | |
virtual void | draw (Ptr< Shader > shader) override |
Draw the mesh using a shader. More... | |
![]() | |
void | setTint (Color tint) |
Set the mesh tint. More... | |
Color & | getTint () |
Get the mesh tint. More... | |
void | updateColor () |
Update the mesh color from the tint. | |
void | setGeometry (Ptr< geom::BaseGeometry > geometry) |
Set the mesh geometry. More... | |
Ptr< geom::BaseGeometry > & | getGeometry () |
Get the mesh geometry. More... | |
Additional Inherited Members | |
![]() | |
Transform | transform |
Mesh transformation. | |
![]() | |
Color | _tint |
Tint color. | |
Ptr< geom::BaseGeometry > | _geometry |
Current geometry. | |
Animated texture-atlas based sprite.
Definition at line 33 of file animation.hpp.
hx3d::graphics::Animation::Animation | ( | ) |
Create an uninitialized animation.
See initialize to create.
Definition at line 26 of file animation.cpp.
hx3d::graphics::Animation::Animation | ( | Ptr< TextureAtlas > | atlas, |
std::vector< std::string > | frames, | ||
float | speed | ||
) |
Create an animation with an atlas, frames and a speed.
atlas | Texture atlas (Ptr) |
frames | Frame names |
speed | Frame speed |
Definition at line 27 of file animation.cpp.
void hx3d::graphics::Animation::initialize | ( | Ptr< TextureAtlas > | atlas, |
std::vector< std::string > | frames, | ||
float | speed | ||
) |
Initialize an animation with an atlas, frames and a speed.
atlas | Texture atlas (Ptr) |
frames | Frame names |
speed | Frame speed |
Definition at line 31 of file animation.cpp.
void hx3d::graphics::Animation::update | ( | float | delta | ) |