UGDK
|
#include <sprite.h>
Public Member Functions | |
Sprite (const Spritesheet *spritesheet, action::AnimationSet *set=NULL) | |
Sprite (const std::string &spritesheet_tag, action::AnimationSet *set=NULL) | |
Sprite (const std::string &spritesheet_tag, const std::string &animation_set_tag) | |
Sprite (const Spritesheet *spritesheet, const std::string &animation_set_tag) | |
virtual | ~Sprite () |
void | Update (double dt) |
void | Draw () const |
const Vector2D & | size () const |
void | SelectAnimation (const std::string &animation_name) |
Change the current animation to a new animation from the previously selected AnimationSet. | |
void | SelectAnimation (int animation_index) |
Change the current animation to a new animation from the previo2usly selected AnimationSet. | |
void | SetAnimationSpeedupFactor (double factor) |
Change the SpeedupFactor of the animation. | |
void | SetAnimationSlowdownFactor (double factor) |
Change the SlowdownFactor of the animation. | |
double | GetAnimationFPS () const |
Return the animation FPS. | |
void | AddObserverToAnimation (action::Observer *observer) |
Add a observer object to the animation. | |
void | AddTickFunctionToAnimation (std::tr1::function< void(void)> tick) |
int | GetAnimationFrameNumber () const |
Return the animation frame number. | |
void | SetDefaultFrame (int frame) |
Set the default frame. |
ugdk::graphic::Sprite::Sprite | ( | const Spritesheet * | spritesheet, |
action::AnimationSet * | set = NULL |
||
) |
ugdk::graphic::Sprite::Sprite | ( | const std::string & | spritesheet_tag, |
action::AnimationSet * | set = NULL |
||
) | [explicit] |
ugdk::graphic::Sprite::Sprite | ( | const std::string & | spritesheet_tag, |
const std::string & | animation_set_tag | ||
) | [explicit] |
ugdk::graphic::Sprite::Sprite | ( | const Spritesheet * | spritesheet, |
const std::string & | animation_set_tag | ||
) | [explicit] |
ugdk::graphic::Sprite::~Sprite | ( | ) | [virtual] |
void ugdk::graphic::Sprite::AddObserverToAnimation | ( | action::Observer * | observer | ) | [inline] |
Add a observer object to the animation.
Given an observer object, the function include this in the animation manager
*observer | is a pointer to the observer object |
void ugdk::graphic::Sprite::AddTickFunctionToAnimation | ( | std::tr1::function< void(void)> | tick | ) | [inline] |
void ugdk::graphic::Sprite::Draw | ( | ) | const [virtual] |
Implements ugdk::graphic::Drawable.
double ugdk::graphic::Sprite::GetAnimationFPS | ( | ) | const [inline] |
Return the animation FPS.
Return the animation FPS
int ugdk::graphic::Sprite::GetAnimationFrameNumber | ( | ) | const [inline] |
Return the animation frame number.
void ugdk::graphic::Sprite::SelectAnimation | ( | const std::string & | animation_name | ) | [inline] |
Change the current animation to a new animation from the previously selected AnimationSet.
Given a animation name (a string), the function changes the current animation to a new animation of AnimationSet
void ugdk::graphic::Sprite::SelectAnimation | ( | int | animation_index | ) | [inline] |
Change the current animation to a new animation from the previo2usly selected AnimationSet.
Given a animation index (a integer), the function changes the current animation to a new animation of AnimationSet
void ugdk::graphic::Sprite::SetAnimationSlowdownFactor | ( | double | factor | ) | [inline] |
Change the SlowdownFactor of the animation.
Given a a factor, this function set the animation SlowdownFactor to this value
factor | is a double |
void ugdk::graphic::Sprite::SetAnimationSpeedupFactor | ( | double | factor | ) | [inline] |
Change the SpeedupFactor of the animation.
Given a a factor, this function set the animation SpeedupFactor to this value
factor | is a double |
void ugdk::graphic::Sprite::SetDefaultFrame | ( | int | frame | ) | [inline] |
Set the default frame.
frame | is a integer |
const Vector2D & ugdk::graphic::Sprite::size | ( | ) | const [virtual] |
Implements ugdk::graphic::Drawable.
void ugdk::graphic::Sprite::Update | ( | double | dt | ) | [virtual] |
Implements ugdk::graphic::Drawable.