isprite_cached_animate_action class
#include <bn_sprite_animate_actions.h>
Base class of bn::
Can be used as a reference type for all bn::
Derived classes
-
template<int MaxSize>class sprite_cached_animate_action
- Changes the tile set of a sprite_
ptr when the action is updated a given number of times.
Public functions
-
auto operator=(const isprite_
cached_ animate_ action& other) -> isprite_ cached_ animate_ action& - Copy assignment operator.
-
auto operator=(isprite_
cached_ animate_ action&& other) -> isprite_ cached_ animate_ action& noexcept - Move assignment operator.
- void update()
- Changes the tile set of the given sprite_
ptr when the given amount of update calls are done. - auto done() const -> bool
- Indicates if the action must not be updated anymore.
- void reset()
- Resets the action to its initial state.
-
auto sprite() const -> const sprite_
ptr& - Returns the sprite_
ptr to modify. - auto wait_updates() const -> int
- Returns the number of times the action must be updated before changing the tiles of the given sprite_
ptr. - void set_wait_updates(int wait_updates)
- Sets the number of times the action must be updated before changing the tiles of the given sprite_
ptr. - auto next_change_updates() const -> int
- Returns the number of times the action must be updated before the next tiles change.
- void set_next_change_updates(int next_change_updates)
- Sets the number of times the action must be updated before the next tiles change.
-
auto tiles_list() const -> const ivector<sprite_
tiles_ ptr>& - Returns the tile sets to use by the given sprite_
ptr. - auto update_forever() const -> bool
- Indicates if the action can be updated forever or not.
- auto current_index() const -> int
- Returns the current index of the given tile sets.
- void set_current_index(int current_index)
- Sets the current index of the given tile sets.
- void set_current_index(int current_index, bool update_sprite_now)
- Sets the current index of the given tile sets.
-
auto current_tiles() const -> const sprite_
tiles_ ptr& - Returns the current tile set.
Function documentation
isprite_ cached_ animate_ action& bn:: isprite_cached_animate_action:: operator=(const isprite_ cached_ animate_ action& other)
Copy assignment operator.
| Parameters | |
|---|---|
| other | isprite_ |
| Returns | Reference to this. |
isprite_ cached_ animate_ action& bn:: isprite_cached_animate_action:: operator=(isprite_ cached_ animate_ action&& other) noexcept
Move assignment operator.
| Parameters | |
|---|---|
| other | isprite_ |
| Returns | Reference to this. |
int bn:: isprite_cached_animate_action:: current_index() const
Returns the current index of the given tile sets.
This index is the one to be used on the next tiles change. It can be out of bounds if the action is done.
void bn:: isprite_cached_animate_action:: set_current_index(int current_index,
bool update_sprite_now)
Sets the current index of the given tile sets.
| Parameters | |
|---|---|
| current_index | New index of the given tile sets. |
| update_sprite_now | Specifies if the sprite must be updated now or on the next tiles change. |
const sprite_ tiles_ ptr& bn:: isprite_cached_animate_action:: current_tiles() const
Returns the current tile set.
This tile set is the one to be used on the next tiles change.