#include <bn_sprite_animate_actions.h>
template<int MaxSize>
sprite_cached_animate_action class
Changes the tile set of a sprite_
| Template parameters | |
|---|---|
| MaxSize | Maximum number of sprite tile sets to store. |
Contents
- Reference
This action differs from 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_ cached_ animate_ action - Generates a sprite_
cached_ 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_ cached_ animate_ action - Generates a sprite_
cached_ animate_ action which loops over the given sprite tile sets only once. -
static auto once(const sprite_
ptr& sprite, int wait_updates, span<sprite_ tiles_ ptr> tiles_list) -> sprite_ cached_ animate_ action - Generates a sprite_
cached_ animate_ action which loops over the given sprite tile sets only once. -
static auto once(sprite_
ptr&& sprite, int wait_updates, span<sprite_ tiles_ ptr> tiles_list) -> sprite_ cached_ animate_ action - Generates a sprite_
cached_ 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_ cached_ animate_ action - Generates a sprite_
cached_ 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_ cached_ animate_ action - Generates a sprite_
cached_ animate_ action which loops over the given sprite tile sets forever. -
static auto forever(const sprite_
ptr& sprite, int wait_updates, span<sprite_ tiles_ ptr> tiles_list) -> sprite_ cached_ animate_ action - Generates a sprite_
cached_ animate_ action which loops over the given sprite tile sets forever. -
static auto forever(sprite_
ptr&& sprite, int wait_updates, span<sprite_ tiles_ ptr> tiles_list) -> sprite_ cached_ animate_ action - Generates a sprite_
cached_ 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_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.
Function documentation
template<int MaxSize>
static sprite_ cached_ animate_ action bn:: sprite_cached_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_ cached_ animate_ action bn:: sprite_cached_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_ cached_ animate_ action bn:: sprite_cached_animate_action<MaxSize>:: once(const sprite_ ptr& sprite,
int wait_updates,
span<sprite_ tiles_ ptr> tiles_list)
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_list | List of tile sets to use by the given sprite_ |
| Returns | The requested sprite_ |
template<int MaxSize>
static sprite_ cached_ animate_ action bn:: sprite_cached_animate_action<MaxSize>:: once(sprite_ ptr&& sprite,
int wait_updates,
span<sprite_ tiles_ ptr> tiles_list)
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_list | List of tile sets to use by the given sprite_ |
| Returns | The requested sprite_ |
template<int MaxSize>
static sprite_ cached_ animate_ action bn:: sprite_cached_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 tiles_item. |
| Returns | The requested sprite_ |
template<int MaxSize>
static sprite_ cached_ animate_ action bn:: sprite_cached_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_ |
template<int MaxSize>
static sprite_ cached_ animate_ action bn:: sprite_cached_animate_action<MaxSize>:: forever(const sprite_ ptr& sprite,
int wait_updates,
span<sprite_ tiles_ ptr> tiles_list)
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_list | List of tile sets to use by the given sprite_ |
| Returns | The requested sprite_ |
template<int MaxSize>
static sprite_ cached_ animate_ action bn:: sprite_cached_animate_action<MaxSize>:: forever(sprite_ ptr&& sprite,
int wait_updates,
span<sprite_ tiles_ ptr> tiles_list)
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_list | Tile sets to use by the given sprite_ |
| Returns | The requested sprite_ |