bn::sprites namespace

Sprites related functions.

Contents

Functions

auto used_items_count() -> int
Returns the number of used sprite items created with sprite_ptr static constructors.
auto available_items_count() -> int
Returns the number of available sprite items that can be created with sprite_ptr static constructors.
auto min_bg_priority() -> int constexpr
auto max_bg_priority() -> int constexpr
auto min_z_order() -> int constexpr
auto max_z_order() -> int constexpr
auto reserved_handles_count() -> int
Returns the number of hardware sprite handles not used by Butano's sprites manager.
void set_reserved_handles_count(int reserved_handles_count)
Sets the number of hardware sprite handles not used by Butano's sprites manager.
void reload()
Reloads the internal attributes of all sprites (including the reserved ones).

Function documentation

int bn::sprites::used_items_count()

Returns the number of used sprite items created with sprite_ptr static constructors.

A sprite item which is outside of the screen or hidden is not committed to the GBA, so there can be more than 128 sprite items.

int bn::sprites::available_items_count()

Returns the number of available sprite items that can be created with sprite_ptr static constructors.

A sprite item which is outside of the screen or hidden is not committed to the GBA, so there can be more than 128 sprite items.

int bn::sprites::min_bg_priority() constexpr

Returns Returns the minimum priority of a sprite relative to backgrounds.

int bn::sprites::max_bg_priority() constexpr

Returns Returns the maximum priority of a sprite relative to backgrounds.

int bn::sprites::min_z_order() constexpr

Returns Returns the minimum priority of a sprite relative to other sprites.

int bn::sprites::max_z_order() constexpr

Returns Returns the maximum priority of a sprite relative to other sprites.

int bn::sprites::reserved_handles_count()

Returns the number of hardware sprite handles not used by Butano's sprites manager.

Normally you should not need to reserve handles, but it can be useful for messing with HDMA for example.

void bn::sprites::set_reserved_handles_count(int reserved_handles_count)

Sets the number of hardware sprite handles not used by Butano's sprites manager.

Normally you should not need to reserve handles, but it can be useful for messing with HDMA for example.

Changing reserved handles count reloads the internal attributes of all sprites (including the reserved ones).

void bn::sprites::reload()

Reloads the internal attributes of all sprites (including the reserved ones).

Normally you should not need to call this function, but it can be useful after messing with HDMA for example.