#include <bn_sprite_animate_actions.h>
template<int MaxSize>
sprite_animate_action class
Changes the tile set of a sprite_
Template parameters | |
---|---|
MaxSize | Maximum number of indexes to sprite tile sets to store. |
Each time the tile set of a sprite_
Public static functions
-
static auto once(const sprite_
ptr& sprite, int wait_updates, const sprite_ tiles_ item& tiles_item, const span<const uint16_t>& graphics_indexes) -> sprite_ animate_ action - Generates a sprite_
animate_ action which loops over the given sprite tile sets only once. -
static auto once(sprite_
ptr&& sprite, int wait_updates, const sprite_ tiles_ item& tiles_item, const span<const uint16_t>& graphics_indexes) -> sprite_ animate_ action - Generates a sprite_
animate_ action which loops over the given sprite tile sets only once. -
static auto forever(const sprite_
ptr& sprite, int wait_updates, const sprite_ tiles_ item& tiles_item, const span<const uint16_t>& graphics_indexes) -> sprite_ animate_ action - Generates a sprite_
animate_ action which loops over the given sprite tile sets forever. -
static auto forever(sprite_
ptr&& sprite, int wait_updates, const sprite_ tiles_ item& tiles_item, const span<const uint16_t>& graphics_indexes) -> sprite_ animate_ action - Generates a sprite_
animate_ action which loops over the given sprite tile sets forever.
Public functions
- 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.
-
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. -
auto tiles_item() const -> const sprite_
tiles_ item& - Returns the sprite_
tiles_ item used to create the new sprite tiles to use by the given sprite_ ptr. - auto graphics_indexes() const -> const ivector<uint16_t>&
- Returns the indexes of the tile sets to reference in the given sprite_
tiles_ item. - 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 graphics_indexes (not the current index of the tile set to reference in the given tiles_item).
Function documentation
template<int MaxSize>
static sprite_ animate_ action bn:: sprite_animate_action<MaxSize>:: once(const sprite_ ptr& sprite,
int wait_updates,
const sprite_ tiles_ item& tiles_item,
const span<const uint16_t>& graphics_indexes)
Generates a sprite_
Parameters | |
---|---|
sprite | sprite_ |
wait_updates | Number of times the action must be updated before changing the tiles of the given sprite_ |
tiles_item | It creates the new sprite tiles to use by the given sprite_ |
graphics_indexes | Indexes of the tile sets to reference in tiles_item. |
Returns | The requested sprite_ |
template<int MaxSize>
static sprite_ animate_ action bn:: sprite_animate_action<MaxSize>:: once(sprite_ ptr&& sprite,
int wait_updates,
const sprite_ tiles_ item& tiles_item,
const span<const uint16_t>& graphics_indexes)
Generates a sprite_
Parameters | |
---|---|
sprite | sprite_ |
wait_updates | Number of times the action must be updated before changing the tiles of the given sprite_ |
tiles_item | It creates the new sprite tiles to use by the given sprite_ |
graphics_indexes | Indexes of the tile sets to reference in the given sprite_ |
Returns | The requested sprite_ |
template<int MaxSize>
static sprite_ animate_ action bn:: sprite_animate_action<MaxSize>:: forever(const sprite_ ptr& sprite,
int wait_updates,
const sprite_ tiles_ item& tiles_item,
const span<const uint16_t>& graphics_indexes)
Generates a sprite_
Parameters | |
---|---|
sprite | sprite_ |
wait_updates | Number of times the action must be updated before changing the tiles of the given sprite_ |
tiles_item | It creates the new sprite tiles to use by the given sprite_ |
graphics_indexes | Indexes of the tile sets to reference in the given sprite_ |
Returns | The requested sprite_ |
template<int MaxSize>
static sprite_ animate_ action bn:: sprite_animate_action<MaxSize>:: forever(sprite_ ptr&& sprite,
int wait_updates,
const sprite_ tiles_ item& tiles_item,
const span<const uint16_t>& graphics_indexes)
Generates a sprite_
Parameters | |
---|---|
sprite | sprite_ |
wait_updates | Number of times the action must be updated before changing the tiles of the given sprite_ |
tiles_item | It creates the new sprite tiles to use by the given sprite_ |
graphics_indexes | Indexes of the tile sets to reference in the given sprite_ |
Returns | The requested sprite_ |