class
#include <bn_sprite_shape_size.h>
sprite_shape_size Calculates sprite dimensions from its shape and size.
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.
- 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. |