sprite_shape_size class
#include <bn_sprite_shape_size.h>
Calculates sprite dimensions from its shape and size.
Contents
| shape / size | small | normal | big | huge |
|---|---|---|---|---|
| square | 8x8 | 16x16 | 32x32 | 64x64 |
| wide | 16x8 | 32x8 | 32x16 | 64x32 |
| tall | 8x16 | 8x32 | 16x32 | 32x64 |
Constructors, destructors, conversion operators
-
sprite_shape_size(sprite_
shape shape, sprite_ size size) 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) -> friend 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. |
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. |