bn::sprite_shape_size class

Calculates sprite dimensions from its shape and size.

Available sprite pixel sizes
shape / sizesmallnormalbighuge
square8x816x1632x3264x64
wide16x832x832x1664x32
tall8x168x3216x3232x64

Constructors, destructors, conversion operators

sprite_shape_size(sprite_shape shape, sprite_size size) constexpr
Constructor.
sprite_shape_size(int width, int height) constexpr
Constructor.

Public functions

auto shape() const -> sprite_shape constexpr
Returns the sprite_shape enum.
auto size() const -> sprite_size constexpr
Returns the sprite_size enum.
auto width() const -> int constexpr
Returns the width of the sprite in pixels.
auto height() const -> int constexpr
Returns the height of the sprite in pixels.
auto pixels_count() const -> int constexpr
Returns the area of the sprite in pixels.
auto tiles_count(bpp_mode bpp) const -> int constexpr
Returns the area of the sprite in tiles.

Friends

auto operator==(const sprite_shape_size& a, const sprite_shape_size& b) -> bool defaulted constexpr
Default equal operator.

Function documentation

bn::sprite_shape_size::sprite_shape_size(sprite_shape shape, sprite_size size) constexpr

Constructor.

Parameters
shape sprite_shape enum.
size sprite_size enum.

bn::sprite_shape_size::sprite_shape_size(int width, int height) constexpr

Constructor.

Parameters
width Width of the sprite in pixels.
height Height of the sprite in pixels.

int bn::sprite_shape_size::tiles_count(bpp_mode bpp) const constexpr

Returns the area of the sprite in tiles.

Parameters
bpp Tiles' bits per pixel mode.
Returns Area of the sprite in tiles.