supertux
Public Member Functions | List of all members
Sprite Class Referencefinal

Public Member Functions

 Sprite (SpriteData &data)
 
SpritePtr clone () const
 
void draw (Canvas &canvas, const Vector &pos, int layer, Flip flip=NO_FLIP)
 Draw sprite, automatically calculates next frame.
 
void set_action (const std::string &name, int loops=-1)
 Set action (or state)
 
void set_action_continued (const std::string &name)
 Set action (or state), but keep current frame number, loop counter, etc. More...
 
void set_animation_loops (int loops=-1)
 Set number of animation cycles until animation stops.
 
void stop_animation ()
 
bool animation_done () const
 Check if animation is stopped or not.
 
int get_frames () const
 Get current action total frames.
 
int get_current_frame () const
 Get currently drawn frame.
 
const std::string & get_name () const
 Get sprite's name.
 
const std::string & get_action () const
 Get current action name.
 
int get_width () const
 
int get_height () const
 
float get_current_hitbox_x_offset () const
 return x-offset of current action's hitbox, relative to start of image
 
float get_current_hitbox_y_offset () const
 return y-offset of current action's hitbox, relative to start of image
 
float get_current_hitbox_width () const
 return width of current action's hitbox
 
float get_current_hitbox_height () const
 return height of current action's hitbox
 
Rectf get_current_hitbox () const
 return current action's hitbox, relative to 0,0
 
void set_angle (float angle)
 Set the angle of the sprite rotation in degree.
 
float get_angle () const
 Get the angle of the sprite rotation in degree.
 
void set_color (const Color &color)
 
Color get_color () const
 
void set_blend (const Blend &blend)
 
Blend get_blend () const
 
bool has_action (const std::string &name) const
 

Member Function Documentation

§ set_action_continued()

void Sprite::set_action_continued ( const std::string &  name)

Set action (or state), but keep current frame number, loop counter, etc.


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