hx3d  1
2D/3D Simple Game Framework
Public Member Functions | List of all members
hx3d::graphics::Animation Class Reference

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...
 
- Public Member Functions inherited from hx3d::graphics::Sprite
 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 &region)
 Set the sprite texture from a texture region. More...
 
Ptr< TexturegetTexture ()
 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...
 
- Public Member Functions inherited from hx3d::graphics::Mesh
void setTint (Color tint)
 Set the mesh tint. More...
 
ColorgetTint ()
 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

- Public Attributes inherited from hx3d::graphics::Mesh
Transform transform
 Mesh transformation.
 
- Protected Attributes inherited from hx3d::graphics::Mesh
Color _tint
 Tint color.
 
Ptr< geom::BaseGeometry_geometry
 Current geometry.
 

Detailed Description

Animated texture-atlas based sprite.

Definition at line 33 of file animation.hpp.

Constructor & Destructor Documentation

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.

Parameters
atlasTexture atlas (Ptr)
framesFrame names
speedFrame speed

Definition at line 27 of file animation.cpp.

Member Function Documentation

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.

Parameters
atlasTexture atlas (Ptr)
framesFrame names
speedFrame speed

Definition at line 31 of file animation.cpp.

void hx3d::graphics::Animation::update ( float  delta)

Update the animation.

Parameters
deltaDelta time

Definition at line 40 of file animation.cpp.


The documentation for this class was generated from the following files: