class
#include <bn_affine_bg_ptr.h>
affine_bg_ptr std::shared_ptr like smart pointer that retains shared ownership of an affine background.
Several affine_
The affine background is released when the last remaining affine_
Public static functions
-
static auto create(const affine_
bg_ item& item) -> affine_ bg_ ptr - Creates an affine_
bg_ ptr from the given affine_ bg_ item. -
static auto create(const affine_
bg_ item& item, int map_index) -> affine_ bg_ ptr - Creates an affine_
bg_ ptr from the given affine_ bg_ item. -
static auto create(affine_
bg_ map_ ptr map) -> affine_ bg_ ptr - Creates an affine_
bg_ ptr from the given affine_ bg_ map_ ptr. -
static auto create(fixed x,
fixed y,
const affine_
bg_ item& item) -> affine_ bg_ ptr - Creates an affine_
bg_ ptr from the given affine_ bg_ item. -
static auto create(fixed x,
fixed y,
const affine_
bg_ item& item, int map_index) -> affine_ bg_ ptr - Creates an affine_
bg_ ptr from the given affine_ bg_ item. -
static auto create(const fixed_
point& position, const affine_ bg_ item& item) -> affine_ bg_ ptr - Creates an affine_
bg_ ptr from the given affine_ bg_ item. -
static auto create(const fixed_
point& position, const affine_ bg_ item& item, int map_index) -> affine_ bg_ ptr - Creates an affine_
bg_ ptr from the given affine_ bg_ item. -
static auto create(fixed x,
fixed y,
affine_
bg_ map_ ptr map) -> affine_ bg_ ptr - Creates an affine_
bg_ ptr from the given affine_ bg_ map_ ptr. -
static auto create(const fixed_
point& position, affine_ bg_ map_ ptr map) -> affine_ bg_ ptr - Creates an affine_
bg_ ptr from the given affine_ bg_ map_ ptr. -
static auto create(const affine_
bg_ builder& builder) -> affine_ bg_ ptr - Creates an affine_
bg_ ptr from an affine_ bg_ builder reference. -
static auto create(affine_
bg_ builder&& builder) -> affine_ bg_ ptr - Creates an affine_
bg_ ptr from a moved affine_ bg_ builder. -
static auto create_optional(const affine_
bg_ item& item) -> optional<affine_ bg_ ptr> - Creates an affine_
bg_ ptr from the given affine_ bg_ item. -
static auto create_optional(const affine_
bg_ item& item, int map_index) -> optional<affine_ bg_ ptr> - Creates an affine_
bg_ ptr from the given affine_ bg_ item. -
static auto create_optional(affine_
bg_ map_ ptr map) -> optional<affine_ bg_ ptr> - Creates an affine_
bg_ ptr from the given affine_ bg_ map_ ptr. -
static auto create_optional(fixed x,
fixed y,
const affine_
bg_ item& item) -> optional<affine_ bg_ ptr> - Creates an affine_
bg_ ptr from the given affine_ bg_ item. -
static auto create_optional(fixed x,
fixed y,
const affine_
bg_ item& item, int map_index) -> optional<affine_ bg_ ptr> - Creates an affine_
bg_ ptr from the given affine_ bg_ item. -
static auto create_optional(const fixed_
point& position, const affine_ bg_ item& item) -> optional<affine_ bg_ ptr> - Creates an affine_
bg_ ptr from the given affine_ bg_ item. -
static auto create_optional(const fixed_
point& position, const affine_ bg_ item& item, int map_index) -> optional<affine_ bg_ ptr> - Creates an affine_
bg_ ptr from the given affine_ bg_ item. -
static auto create_optional(fixed x,
fixed y,
affine_
bg_ map_ ptr map) -> optional<affine_ bg_ ptr> - Creates an affine_
bg_ ptr from the given affine_ bg_ map_ ptr. -
static auto create_optional(const fixed_
point& position, affine_ bg_ map_ ptr map) -> optional<affine_ bg_ ptr> - Creates an affine_
bg_ ptr from the given affine_ bg_ map_ ptr. -
static auto create_optional(const affine_
bg_ builder& builder) -> optional<affine_ bg_ ptr> - Creates an affine_
bg_ ptr from an affine_ bg_ builder reference. -
static auto create_optional(affine_
bg_ builder&& builder) -> optional<affine_ bg_ ptr> - Creates an affine_
bg_ ptr from a moved affine_ bg_ builder.
Constructors, destructors, conversion operators
-
affine_bg_ptr(const affine_
bg_ ptr& other) - Copy constructor.
-
affine_bg_ptr(affine_
bg_ ptr&& other) noexcept - Move constructor.
- ~affine_bg_ptr()
- Releases the referenced affine background if no more affine_
bg_ ptr objects reference to it.
Public functions
-
auto operator=(const affine_
bg_ ptr& other) -> affine_ bg_ ptr& - Copy assignment operator.
-
auto operator=(affine_
bg_ ptr&& other) -> affine_ bg_ ptr& noexcept - Move assignment operator.
- auto dimensions() const -> size
- Returns the size in pixels of the affine background.
- auto big() const -> bool
- Indicates if this affine background is big or not.
-
auto tiles() const -> const affine_
bg_ tiles_ ptr& - Returns the tiles used by this affine background.
-
void set_tiles(const affine_
bg_ tiles_ ptr& tiles) - Sets the tiles used by this affine background.
-
void set_tiles(affine_
bg_ tiles_ ptr&& tiles) - Sets the tiles used by this affine background.
-
void set_tiles(const affine_
bg_ tiles_ item& tiles_item) - Replaces the tiles used by this affine background with a new tile set created with the given affine_
bg_ tiles_ item. -
auto palette() const -> const bg_
palette_ ptr& - Returns the color palette used by this affine background.
-
void set_palette(const bg_
palette_ ptr& palette) - Sets the color palette to use by this affine background.
-
void set_palette(bg_
palette_ ptr&& palette) - Sets the color palette to use by this affine background.
-
void set_palette(const bg_
palette_ item& palette_item) - Replaces the color palette used by this affine background with a new one created with the given bg_
palette_ item. -
auto map() const -> const affine_
bg_ map_ ptr& - Returns the map used by this affine background.
-
void set_map(const affine_
bg_ map_ ptr& map) - Sets the map used by this affine background.
-
void set_map(affine_
bg_ map_ ptr&& map) - Sets the map used by this affine background.
-
void set_map(const affine_
bg_ map_ item& map_item) - Replaces the map used by this affine background with a new map created with the given affine_
bg_ map_ item. -
void set_map(const affine_
bg_ map_ item& map_item, int map_index) - Replaces the map used by this affine background with a new map created with the given affine_
bg_ map_ item. -
void set_item(const affine_
bg_ item& item) - Replaces the tiles, the color palette and the map used by this affine background with the created with the given affine_
bg_ item. -
void set_item(const affine_
bg_ item& item, int map_index) - Replaces the tiles, the color palette and the map used by this affine background with the created with the given affine_
bg_ item. - auto x() const -> fixed
- Returns the horizontal position of the affine background (relative to its camera, if it has one).
- void set_x(fixed x)
- Sets the horizontal position of the affine background (relative to its camera, if it has one).
- auto y() const -> fixed
- Returns the vertical position of the affine background (relative to its camera, if it has one).
- void set_y(fixed y)
- Sets the vertical position of the affine background (relative to its camera, if it has one).
-
auto position() const -> const fixed_
point& - Returns the position of the affine background (relative to its camera, if it has one).
- void set_position(fixed x, fixed y)
- Sets the position of the affine background (relative to its camera, if it has one).
-
void set_position(const fixed_
point& position) - Sets the position of the affine background (relative to its camera, if it has one).
- auto top_left_x() const -> fixed
- Returns the horizontal top-left position of the affine background (relative to its camera, if it has one).
- void set_top_left_x(fixed top_left_x)
- Sets the horizontal top-left position of the affine background (relative to its camera, if it has one).
- auto top_left_y() const -> fixed
- Returns the vertical top-left position of the affine background (relative to its camera, if it has one).
- void set_top_left_y(fixed top_left_y)
- Sets the vertical top-left position of the affine background (relative to its camera, if it has one).
-
auto top_left_position() const -> fixed_
point - Returns the top-left position of the affine background (relative to its camera, if it has one).
- void set_top_left_position(fixed top_left_x, fixed top_left_y)
- Sets the top-left position of the affine background (relative to its camera, if it has one).
-
void set_top_left_position(const fixed_
point& top_left_position) - Sets the top-left position of the affine background (relative to its camera, if it has one).
- auto rotation_angle() const -> fixed
- Returns the rotation angle in degrees of the affine background.
- void set_rotation_angle(fixed rotation_angle)
- Sets the rotation angle in degrees of the affine background.
- void set_rotation_angle_safe(fixed rotation_angle)
- Sets the rotation angle in degrees of the affine background.
- auto horizontal_scale() const -> fixed
- Returns the horizontal scale of the affine background.
- void set_horizontal_scale(fixed horizontal_scale)
- Sets the horizontal scale of the affine background.
- auto vertical_scale() const -> fixed
- Returns the vertical scale of the affine background.
- void set_vertical_scale(fixed vertical_scale)
- Sets the vertical scale of the affine background.
- void set_scale(fixed scale)
- Sets the scale of the affine background.
- void set_scale(fixed horizontal_scale, fixed vertical_scale)
- Sets the scale of the affine background.
- auto horizontal_shear() const -> fixed
- Returns the horizontal shear of the affine background.
- void set_horizontal_shear(fixed horizontal_shear)
- Sets the horizontal shear of the affine background.
- auto vertical_shear() const -> fixed
- Returns the vertical shear of the affine background.
- void set_vertical_shear(fixed vertical_shear)
- Sets the vertical shear of the affine background.
- void set_shear(fixed shear)
- Sets the shear of the affine background.
- void set_shear(fixed horizontal_shear, fixed vertical_shear)
- Sets the shear of the affine background.
- auto horizontal_flip() const -> bool
- Indicates if this affine background is flipped in the horizontal axis or not.
- void set_horizontal_flip(bool horizontal_flip)
- Sets if this affine background must be flipped in the horizontal axis or not.
- auto vertical_flip() const -> bool
- Indicates if this affine background must be flipped in the vertical axis or not.
- void set_vertical_flip(bool vertical_flip)
- Sets if this affine background must be flipped in the vertical axis or not.
- auto pivot_x() const -> fixed
- Returns the horizontal position of the affine transformations pivot point of this affine background.
- void set_pivot_x(fixed pivot_x)
- Sets the horizontal position of the affine transformations pivot point of this affine background.
- auto pivot_y() const -> fixed
- Returns the vertical position of the affine transformations pivot point of this affine background.
- void set_pivot_y(fixed pivot_y)
- Sets the vertical position of the affine transformations pivot point of this affine background.
-
auto pivot_position() const -> const fixed_
point& - Returns the position of the affine transformations pivot point of this affine background.
- void set_pivot_position(fixed pivot_x, fixed pivot_y)
- Sets the position of the affine transformations pivot point of this affine background.
-
void set_pivot_position(const fixed_
point& pivot_position) - Sets the position of the affine transformations pivot point of this affine background.
-
auto mat_attributes() const -> const affine_
bg_ mat_ attributes& - Returns the attributes of the position and the transformation matrix of this affine background.
-
void set_mat_attributes(const affine_
mat_ attributes& mat_attributes) - Sets the attributes of the affine transformation matrix of this affine background.
- auto priority() const -> int
- Returns the priority of the affine background relative to sprites and other backgrounds.
- void set_priority(int priority)
- Sets the priority of the affine background relative to sprites and other backgrounds.
- auto z_order() const -> int
- Returns the priority of the affine background relative to other backgrounds, excluding sprites.
- void set_z_order(int z_order)
- Sets the priority of the affine background relative to other backgrounds, excluding sprites.
- void put_above()
- Modify this affine background to be drawn above all of the other backgrounds with the same priority.
- void put_below()
- Modify this affine background to be drawn below all of the other backgrounds with the same priority.
- auto wrapping_enabled() const -> bool
- Indicates if this affine background wraps around at the edges or not.
- void set_wrapping_enabled(bool wrapping_enabled)
- Sets if this affine background must wrap around at the edges or not.
- auto mosaic_enabled() const -> bool
- Indicates if the mosaic effect must be applied to this affine background or not.
- void set_mosaic_enabled(bool mosaic_enabled)
- Sets if the mosaic effect must be applied to this affine background or not.
- auto blending_enabled() const -> bool
- Indicates if blending must be applied to this affine background or not.
- void set_blending_enabled(bool blending_enabled)
- Sets if blending must be applied to this affine background or not.
- auto blending_top_enabled() const -> bool
- Indicates if this affine background is part of the blending top layer or not.
- void set_blending_top_enabled(bool blending_top_enabled)
- Sets if this affine background is part of the blending top layer or not.
- auto blending_bottom_enabled() const -> bool
- Indicates if this affine background is part of the blending bottom layer or not.
- void set_blending_bottom_enabled(bool blending_bottom_enabled)
- Sets if this affine background is part of the blending bottom layer or not.
- auto visible() const -> bool
- Indicates if this affine background must be committed to the GBA or not.
- void set_visible(bool visible)
- Sets if this affine background must be committed to the GBA or not.
- auto visible_in_window(const window& window) const -> bool
- Indicates if this affine background is visible in the given window or not.
- void set_visible_in_window(bool visible, window& window)
- Sets if this affine background must be visible in the given window or not.
-
auto camera() const -> const optional<camera_
ptr>& - Returns the camera_
ptr attached to this affine background (if any). -
void set_camera(const camera_
ptr& camera) - Sets the camera_
ptr attached to this affine background. -
void set_camera(camera_
ptr&& camera) - Sets the camera_
ptr attached to this affine background. -
void set_camera(const optional<camera_
ptr>& camera) - Sets or removes the camera_
ptr attached to this affine background. -
void set_camera(optional<camera_
ptr>&& camera) - Sets or removes the camera_
ptr attached to this affine background. - void remove_camera()
- Removes the camera_
ptr attached to this affine background (if any). -
auto attributes() const -> affine_
bg_ attributes - Returns the attributes to commit to the GBA for this affine background.
-
void set_attributes(const affine_
bg_ attributes& attributes) - Sets the attributes to commit to the GBA for this affine background.
- auto hw_id() const -> optional<int>
- Returns the hardware ID assigned to this background or bn::
nullopt if no hardware ID has been assigned. - auto handle() const -> const void*
- Returns the internal handle.
-
void swap(affine_
bg_ ptr& other) - Exchanges the contents of this affine_
bg_ ptr with those of the other one.
Friends
-
void swap(affine_
bg_ ptr& a, affine_ bg_ ptr& b) - Exchanges the contents of an affine_
bg_ ptr with those of another one. -
auto operator==(const affine_
bg_ ptr& a, const affine_ bg_ ptr& b) -> bool defaulted - Default equal operator.
Function documentation
static affine_ bg_ ptr bn:: affine_bg_ptr:: create(const affine_ bg_ item& item)
Creates an affine_
Parameters | |
---|---|
item | affine_ |
Returns | The requested affine_ |
static affine_ bg_ ptr bn:: affine_bg_ptr:: create(const affine_ bg_ item& item,
int map_index)
Creates an affine_
Parameters | |
---|---|
item | affine_ |
map_index | Index of the map to reference in item.map_item(). |
Returns | The requested affine_ |
static affine_ bg_ ptr bn:: affine_bg_ptr:: create(affine_ bg_ map_ ptr map)
Creates an affine_
Parameters | |
---|---|
map | affine_ |
Returns | The requested affine_ |
static affine_ bg_ ptr bn:: affine_bg_ptr:: create(fixed x,
fixed y,
const affine_ bg_ item& item)
Creates an affine_
Parameters | |
---|---|
x | Horizontal position of the affine background. |
y | Vertical position of the affine background. |
item | affine_ |
Returns | The requested affine_ |
static affine_ bg_ ptr bn:: affine_bg_ptr:: create(fixed x,
fixed y,
const affine_ bg_ item& item,
int map_index)
Creates an affine_
Parameters | |
---|---|
x | Horizontal position of the affine background. |
y | Vertical position of the affine background. |
item | affine_ |
map_index | Index of the map to reference in item.map_item(). |
Returns | The requested affine_ |
static affine_ bg_ ptr bn:: affine_bg_ptr:: create(const fixed_ point& position,
const affine_ bg_ item& item)
Creates an affine_
Parameters | |
---|---|
position | Position of the affine background. |
item | affine_ |
Returns | The requested affine_ |
static affine_ bg_ ptr bn:: affine_bg_ptr:: create(const fixed_ point& position,
const affine_ bg_ item& item,
int map_index)
Creates an affine_
Parameters | |
---|---|
position | Position of the affine background. |
item | affine_ |
map_index | Index of the map to reference in item.map_item(). |
Returns | The requested affine_ |
static affine_ bg_ ptr bn:: affine_bg_ptr:: create(fixed x,
fixed y,
affine_ bg_ map_ ptr map)
Creates an affine_
Parameters | |
---|---|
x | Horizontal position of the affine background. |
y | Vertical position of the affine background. |
map | affine_ |
Returns | The requested affine_ |
static affine_ bg_ ptr bn:: affine_bg_ptr:: create(const fixed_ point& position,
affine_ bg_ map_ ptr map)
Creates an affine_
Parameters | |
---|---|
position | Position of the affine background. |
map | affine_ |
Returns | The requested affine_ |
static affine_ bg_ ptr bn:: affine_bg_ptr:: create(const affine_ bg_ builder& builder)
Creates an affine_
Parameters | |
---|---|
builder | affine_ |
Returns | The requested affine_ |
static affine_ bg_ ptr bn:: affine_bg_ptr:: create(affine_ bg_ builder&& builder)
Creates an affine_
Parameters | |
---|---|
builder | affine_ |
Returns | The requested affine_ |
static optional<affine_ bg_ ptr> bn:: affine_bg_ptr:: create_optional(const affine_ bg_ item& item)
Creates an affine_
Parameters | |
---|---|
item | affine_ |
Returns | The requested affine_ |
static optional<affine_ bg_ ptr> bn:: affine_bg_ptr:: create_optional(const affine_ bg_ item& item,
int map_index)
Creates an affine_
Parameters | |
---|---|
item | affine_ |
map_index | Index of the map to reference in item.map_item(). |
Returns | The requested affine_ |
static optional<affine_ bg_ ptr> bn:: affine_bg_ptr:: create_optional(affine_ bg_ map_ ptr map)
Creates an affine_
Parameters | |
---|---|
map | affine_ |
Returns | The requested affine_ |
static optional<affine_ bg_ ptr> bn:: affine_bg_ptr:: create_optional(fixed x,
fixed y,
const affine_ bg_ item& item)
Creates an affine_
Parameters | |
---|---|
x | Horizontal position of the affine background. |
y | Vertical position of the affine background. |
item | affine_ |
Returns | The requested affine_ |
static optional<affine_ bg_ ptr> bn:: affine_bg_ptr:: create_optional(fixed x,
fixed y,
const affine_ bg_ item& item,
int map_index)
Creates an affine_
Parameters | |
---|---|
x | Horizontal position of the affine background. |
y | Vertical position of the affine background. |
item | affine_ |
map_index | Index of the map to reference in item.map_item(). |
Returns | The requested affine_ |
static optional<affine_ bg_ ptr> bn:: affine_bg_ptr:: create_optional(const fixed_ point& position,
const affine_ bg_ item& item)
Creates an affine_
Parameters | |
---|---|
position | Position of the affine background. |
item | affine_ |
Returns | The requested affine_ |
static optional<affine_ bg_ ptr> bn:: affine_bg_ptr:: create_optional(const fixed_ point& position,
const affine_ bg_ item& item,
int map_index)
Creates an affine_
Parameters | |
---|---|
position | Position of the affine background. |
item | affine_ |
map_index | Index of the map to reference in item.map_item(). |
Returns | The requested affine_ |
static optional<affine_ bg_ ptr> bn:: affine_bg_ptr:: create_optional(fixed x,
fixed y,
affine_ bg_ map_ ptr map)
Creates an affine_
Parameters | |
---|---|
x | Horizontal position of the affine background. |
y | Vertical position of the affine background. |
map | affine_ |
Returns | The requested affine_ |
static optional<affine_ bg_ ptr> bn:: affine_bg_ptr:: create_optional(const fixed_ point& position,
affine_ bg_ map_ ptr map)
Creates an affine_
Parameters | |
---|---|
position | Position of the affine background. |
map | affine_ |
Returns | The requested affine_ |
static optional<affine_ bg_ ptr> bn:: affine_bg_ptr:: create_optional(const affine_ bg_ builder& builder)
Creates an affine_
Parameters | |
---|---|
builder | affine_ |
Returns | The requested affine_ |
static optional<affine_ bg_ ptr> bn:: affine_bg_ptr:: create_optional(affine_ bg_ builder&& builder)
Creates an affine_
Parameters | |
---|---|
builder | affine_ |
Returns | The requested affine_ |
bn:: affine_bg_ptr:: affine_bg_ptr(const affine_ bg_ ptr& other)
Copy constructor.
Parameters | |
---|---|
other | affine_ |
bn:: affine_bg_ptr:: affine_bg_ptr(affine_ bg_ ptr&& other) noexcept
Move constructor.
Parameters | |
---|---|
other | affine_ |
affine_ bg_ ptr& bn:: affine_bg_ptr:: operator=(const affine_ bg_ ptr& other)
Copy assignment operator.
Parameters | |
---|---|
other | affine_ |
Returns | Reference to this. |
affine_ bg_ ptr& bn:: affine_bg_ptr:: operator=(affine_ bg_ ptr&& other) noexcept
Move assignment operator.
Parameters | |
---|---|
other | affine_ |
Returns | Reference to this. |
bool bn:: affine_bg_ptr:: big() const
Indicates if this affine background is big or not.
Big backgrounds are slower CPU wise, but can have any width or height multiple of 256 pixels.
void bn:: affine_bg_ptr:: set_tiles(const affine_ bg_ tiles_ ptr& tiles)
Sets the tiles used by this affine background.
Parameters | |
---|---|
tiles | affine_ |
It must be compatible with the current map of the affine background.
void bn:: affine_bg_ptr:: set_tiles(affine_ bg_ tiles_ ptr&& tiles)
Sets the tiles used by this affine background.
Parameters | |
---|---|
tiles | affine_ |
It must be compatible with the current map of the affine background.
void bn:: affine_bg_ptr:: set_tiles(const affine_ bg_ tiles_ item& tiles_item)
Replaces the tiles used by this affine background with a new tile set created with the given affine_
Parameters | |
---|---|
tiles_item | It creates the new background tiles to use by this affine background. |
Before creating a new background tile set, the affine_
The new background tiles must be compatible with the current map of the affine background.
void bn:: affine_bg_ptr:: set_palette(const bg_ palette_ ptr& palette)
Sets the color palette to use by this affine background.
Parameters | |
---|---|
palette | bg_ |
void bn:: affine_bg_ptr:: set_palette(bg_ palette_ ptr&& palette)
Sets the color palette to use by this affine background.
Parameters | |
---|---|
palette | bg_ |
void bn:: affine_bg_ptr:: set_palette(const bg_ palette_ item& palette_item)
Replaces the color palette used by this affine background with a new one created with the given bg_
Parameters | |
---|---|
palette_item | It creates the color palette to use by this affine background. |
Before creating a new color palette, the bg_
void bn:: affine_bg_ptr:: set_map(const affine_ bg_ map_ ptr& map)
Sets the map used by this affine background.
Parameters | |
---|---|
map | affine_ |
void bn:: affine_bg_ptr:: set_map(affine_ bg_ map_ ptr&& map)
Sets the map used by this affine background.
Parameters | |
---|---|
map | affine_ |
void bn:: affine_bg_ptr:: set_map(const affine_ bg_ map_ item& map_item)
Replaces the map used by this affine background with a new map created with the given affine_
Parameters | |
---|---|
map_item | It creates the new map to use by this affine background. |
Before creating a new map, the affine_
void bn:: affine_bg_ptr:: set_map(const affine_ bg_ map_ item& map_item,
int map_index)
Replaces the map used by this affine background with a new map created with the given affine_
Parameters | |
---|---|
map_item | It creates the new map to use by this affine background. |
map_index | Index of the map to reference in map_item. |
Before creating a new map, the affine_
void bn:: affine_bg_ptr:: set_item(const affine_ bg_ item& item)
Replaces the tiles, the color palette and the map used by this affine background with the created with the given affine_
Parameters | |
---|---|
item | It creates the resources to use by this affine background. |
Before creating new resources, the resources used by this affine background are removed, so VRAM usage is reduced.
void bn:: affine_bg_ptr:: set_item(const affine_ bg_ item& item,
int map_index)
Replaces the tiles, the color palette and the map used by this affine background with the created with the given affine_
Parameters | |
---|---|
item | It creates the resources to use by this affine background. |
map_index | Index of the map to reference in item.map_item(). |
Before creating new resources, the resources used by this affine background are removed, so VRAM usage is reduced.
void bn:: affine_bg_ptr:: set_position(fixed x,
fixed y)
Sets the position of the affine background (relative to its camera, if it has one).
Parameters | |
---|---|
x | Horizontal position of the affine background (relative to its camera, if it has one). |
y | Vertical position of the affine background (relative to its camera, if it has one). |
void bn:: affine_bg_ptr:: set_top_left_position(fixed top_left_x,
fixed top_left_y)
Sets the top-left position of the affine background (relative to its camera, if it has one).
Parameters | |
---|---|
top_left_x | Horizontal top-left position of the affine background (relative to its camera, if it has one). |
top_left_y | Vertical top-left position of the affine background (relative to its camera, if it has one). |
void bn:: affine_bg_ptr:: set_rotation_angle(fixed rotation_angle)
Sets the rotation angle in degrees of the affine background.
Parameters | |
---|---|
rotation_angle | Rotation angle in degrees, in the range [0..360]. |
void bn:: affine_bg_ptr:: set_rotation_angle_safe(fixed rotation_angle)
Sets the rotation angle in degrees of the affine background.
Parameters | |
---|---|
rotation_angle | Rotation angle in degrees, in any range. |
void bn:: affine_bg_ptr:: set_pivot_position(fixed pivot_x,
fixed pivot_y)
Sets the position of the affine transformations pivot point of this affine background.
Parameters | |
---|---|
pivot_x | Horizontal position of the pivot point. |
pivot_y | Vertical position of the pivot point. |
void bn:: affine_bg_ptr:: set_pivot_position(const fixed_ point& pivot_position)
Sets the position of the affine transformations pivot point of this affine background.
Parameters | |
---|---|
pivot_position | Position of the pivot point. |
int bn:: affine_bg_ptr:: priority() const
Returns the priority of the affine background relative to sprites and other backgrounds.
Backgrounds with higher priority are drawn first (and therefore can be covered by later sprites and backgrounds).
void bn:: affine_bg_ptr:: set_priority(int priority)
Sets the priority of the affine background relative to sprites and other backgrounds.
Parameters | |
---|---|
priority | Priority in the range [0..3]. |
Backgrounds with higher priority are drawn first (and therefore can be covered by later sprites and backgrounds).
int bn:: affine_bg_ptr:: z_order() const
Returns the priority of the affine background relative to other backgrounds, excluding sprites.
Backgrounds with higher z orders are drawn first (and therefore can be covered by later backgrounds).
Due to hardware limitations, affine backgrounds can be drawn before regular backgrounds with higher z order.
void bn:: affine_bg_ptr:: set_z_order(int z_order)
Sets the priority of the affine background relative to other backgrounds, excluding sprites.
Parameters | |
---|---|
z_order | Priority relative to other backgrounds, excluding sprites, in the range [-32767..32767]. |
Backgrounds with higher z orders are drawn first (and therefore can be covered by later backgrounds).
Due to hardware limitations, affine backgrounds can be drawn before regular backgrounds with higher z order.
bool bn:: affine_bg_ptr:: blending_enabled() const
Indicates if blending must be applied to this affine background or not.
Blending is applied to this affine background by making it part of the blending top layer.
void bn:: affine_bg_ptr:: set_blending_enabled(bool blending_enabled)
Sets if blending must be applied to this affine background or not.
Blending is applied to this affine background by making it part of the blending top layer.
void bn:: affine_bg_ptr:: set_camera(const camera_ ptr& camera)
Sets the camera_
Parameters | |
---|---|
camera | camera_ |
void bn:: affine_bg_ptr:: set_camera(camera_ ptr&& camera)
Sets the camera_
Parameters | |
---|---|
camera | camera_ |
void bn:: affine_bg_ptr:: set_camera(const optional<camera_ ptr>& camera)
Sets or removes the camera_
Parameters | |
---|---|
camera | Optional camera_ |
void bn:: affine_bg_ptr:: set_camera(optional<camera_ ptr>&& camera)
Sets or removes the camera_
Parameters | |
---|---|
camera | Optional camera_ |
optional<int> bn:: affine_bg_ptr:: hw_id() const
Returns the hardware ID assigned to this background or bn::
Normally you should not need to call this function, but it can be useful for messing with HDMA for example.
A background doesn't have an assigned hardware ID if it is not visible.
Assigned hardware ID can change after calling this method if some properties of this background or others are updated.
Call this method at your own risk.
void bn:: affine_bg_ptr:: swap(affine_ bg_ ptr& other)
Exchanges the contents of this affine_
Parameters | |
---|---|
other | affine_ |
void swap(affine_ bg_ ptr& a,
affine_ bg_ ptr& b)
Exchanges the contents of an affine_
Parameters | |
---|---|
a | First affine_ |
b | Second affine_ |