#include <map_actions.h>
Inheritance diagram for hoa_map::private_map::ActionAnimate:


Public Member Functions | |
| ActionAnimate (VirtualSprite *sprite) | |
| void | AddFrame (uint16 frame, uint32 time) |
| void | Execute () |
| Executes the sprite's action. | |
| void | SetLoops (int8 count) |
| ~ActionAnimate () | |
Public Attributes | |
| uint32 | current_frame |
| Indicates the current frame. | |
| std::vector< uint32 > | display_times |
| Indicates how long to display each frame The size of this vector should be equal to the size of the frames vector. | |
| std::vector< uint16 > | frames |
| The sprite animation to display for this action. This is an index to the sprite's animations vector. | |
| int8 | loop_count |
| A counter for the number of loops. | |
| int8 | loops |
| The number of times to loop the series of frames before finishing. A value less than zero indicates to loop forever. Be careful with this, because that means that the action would never arrive at the "finished" state. | |
| uint32 | timer |
| Used to count down the display time of the current frame. | |
****************************************************************************
This action displays a certain animation in a sprite for a certain amount of time. It supports multiple animation + time combinations as well as looping through these animations. Its primary purpose is to allow complete control over how a sprite reacts to its surroundings, such as flipping through a book taken from a bookshelf.
These actions can not be used with VirtualSprite objects, since this class explicitly needs animation images to work and virtual sprites have no sprite images to work with.
You MUST add at least one frame to the object if you are intending to use it. Calling the Execute() function when the object contains no frame entries will cause a segmentation fault.
Definition at line 193 of file map_actions.h.
| hoa_map::private_map::ActionAnimate::ActionAnimate | ( | VirtualSprite * | sprite | ) | [inline] |
Definition at line 224 of file map_actions.h.
| hoa_map::private_map::ActionAnimate::~ActionAnimate | ( | ) | [inline] |
Definition at line 227 of file map_actions.h.
| void hoa_map::private_map::ActionAnimate::Execute | ( | ) | [virtual] |
Executes the sprite's action.
Implements hoa_map::private_map::SpriteAction.
Definition at line 113 of file map_actions.cpp.
References hoa_map::private_map::SpriteAction::_finished, hoa_map::private_map::SpriteAction::_sprite, current_frame, display_times, frames, hoa_system::GameSystem::GetUpdateTime(), loop_count, loops, hoa_system::SystemManager, and timer.
Here is the call graph for this function:

| void hoa_map::private_map::ActionAnimate::SetLoops | ( | int8 | count | ) | [inline] |
| std::vector<uint32> hoa_map::private_map::ActionAnimate::display_times |
Indicates how long to display each frame The size of this vector should be equal to the size of the frames vector.
Definition at line 203 of file map_actions.h.
Referenced by AddFrame(), and Execute().
| std::vector<uint16> hoa_map::private_map::ActionAnimate::frames |
The sprite animation to display for this action. This is an index to the sprite's animations vector.
Definition at line 198 of file map_actions.h.
Referenced by AddFrame(), and Execute().
A counter for the number of loops.
Definition at line 212 of file map_actions.h.
Referenced by Execute().
The number of times to loop the series of frames before finishing. A value less than zero indicates to loop forever. Be careful with this, because that means that the action would never arrive at the "finished" state.
Definition at line 222 of file map_actions.h.
Referenced by Execute(), and SetLoops().
Used to count down the display time of the current frame.
Definition at line 209 of file map_actions.h.
Referenced by Execute().
1.5.1