class
#include <bn_regular_bg_ptr.h>
regular_bg_ptr std::shared_ptr like smart pointer that retains shared ownership of a regular background.
Several regular_
The regular background is released when the last remaining regular_
Public static functions
-
static auto create(const regular_
bg_ item& item) -> regular_ bg_ ptr - Creates a regular_
bg_ ptr from the given regular_ bg_ item. -
static auto create(const regular_
bg_ item& item, int map_index) -> regular_ bg_ ptr - Creates a regular_
bg_ ptr from the given regular_ bg_ item. -
static auto create(regular_
bg_ map_ ptr map) -> regular_ bg_ ptr - Creates a regular_
bg_ ptr from the given regular_ bg_ map_ ptr. -
static auto create(fixed x,
fixed y,
const regular_
bg_ item& item) -> regular_ bg_ ptr - Creates a regular_
bg_ ptr from the given regular_ bg_ item. -
static auto create(fixed x,
fixed y,
const regular_
bg_ item& item, int map_index) -> regular_ bg_ ptr - Creates a regular_
bg_ ptr from the given regular_ bg_ item. -
static auto create(const fixed_
point& position, const regular_ bg_ item& item) -> regular_ bg_ ptr - Creates a regular_
bg_ ptr from the given regular_ bg_ item. -
static auto create(const fixed_
point& position, const regular_ bg_ item& item, int map_index) -> regular_ bg_ ptr - Creates a regular_
bg_ ptr from the given regular_ bg_ item. -
static auto create(fixed x,
fixed y,
regular_
bg_ map_ ptr map) -> regular_ bg_ ptr - Creates a regular_
bg_ ptr from the given regular_ bg_ map_ ptr. -
static auto create(const fixed_
point& position, regular_ bg_ map_ ptr map) -> regular_ bg_ ptr - Creates a regular_
bg_ ptr from the given regular_ bg_ map_ ptr. -
static auto create(const regular_
bg_ builder& builder) -> regular_ bg_ ptr - Creates a regular_
bg_ ptr from a regular_ bg_ builder reference. -
static auto create(regular_
bg_ builder&& builder) -> regular_ bg_ ptr - Creates a regular_
bg_ ptr from a moved regular_ bg_ builder. -
static auto create_optional(const regular_
bg_ item& item) -> optional<regular_ bg_ ptr> - Creates a regular_
bg_ ptr from the given regular_ bg_ item. -
static auto create_optional(const regular_
bg_ item& item, int map_index) -> optional<regular_ bg_ ptr> - Creates a regular_
bg_ ptr from the given regular_ bg_ item. -
static auto create_optional(regular_
bg_ map_ ptr map) -> optional<regular_ bg_ ptr> - Creates a regular_
bg_ ptr from the given regular_ bg_ map_ ptr. -
static auto create_optional(fixed x,
fixed y,
const regular_
bg_ item& item) -> optional<regular_ bg_ ptr> - Creates a regular_
bg_ ptr from the given regular_ bg_ item. -
static auto create_optional(fixed x,
fixed y,
const regular_
bg_ item& item, int map_index) -> optional<regular_ bg_ ptr> - Creates a regular_
bg_ ptr from the given regular_ bg_ item. -
static auto create_optional(const fixed_
point& position, const regular_ bg_ item& item) -> optional<regular_ bg_ ptr> - Creates a regular_
bg_ ptr from the given regular_ bg_ item. -
static auto create_optional(const fixed_
point& position, const regular_ bg_ item& item, int map_index) -> optional<regular_ bg_ ptr> - Creates a regular_
bg_ ptr from the given regular_ bg_ item. -
static auto create_optional(fixed x,
fixed y,
regular_
bg_ map_ ptr map) -> optional<regular_ bg_ ptr> - Creates a regular_
bg_ ptr from the given regular_ bg_ map_ ptr. -
static auto create_optional(const fixed_
point& position, regular_ bg_ map_ ptr map) -> optional<regular_ bg_ ptr> - Creates a regular_
bg_ ptr from the given regular_ bg_ map_ ptr. -
static auto create_optional(const regular_
bg_ builder& builder) -> optional<regular_ bg_ ptr> - Creates a regular_
bg_ ptr from a regular_ bg_ builder reference. -
static auto create_optional(regular_
bg_ builder&& builder) -> optional<regular_ bg_ ptr> - Creates a regular_
bg_ ptr from a moved regular_ bg_ builder.
Constructors, destructors, conversion operators
-
regular_bg_ptr(const regular_
bg_ ptr& other) - Copy constructor.
-
regular_bg_ptr(regular_
bg_ ptr&& other) noexcept - Move constructor.
- ~regular_bg_ptr()
- Releases the referenced regular background if no more regular_
bg_ ptr objects reference to it.
Public functions
-
auto operator=(const regular_
bg_ ptr& other) -> regular_ bg_ ptr& - Copy assignment operator.
-
auto operator=(regular_
bg_ ptr&& other) -> regular_ bg_ ptr& noexcept - Move assignment operator.
- auto dimensions() const -> size
- Returns the size in pixels of the regular background.
- auto big() const -> bool
- Indicates if this regular background is big or not.
-
auto tiles() const -> const regular_
bg_ tiles_ ptr& - Returns the tiles used by this regular background.
-
void set_tiles(const regular_
bg_ tiles_ ptr& tiles) - Sets the tiles used by this regular background.
-
void set_tiles(regular_
bg_ tiles_ ptr&& tiles) - Sets the tiles used by this regular background.
-
void set_tiles(const regular_
bg_ tiles_ item& tiles_item) - Replaces the tiles used by this regular background with a new tile set created with the given regular_
bg_ tiles_ item. -
auto palette() const -> const bg_
palette_ ptr& - Returns the color palette used by this regular background.
-
void set_palette(const bg_
palette_ ptr& palette) - Sets the color palette to use by this regular background.
-
void set_palette(bg_
palette_ ptr&& palette) - Sets the color palette to use by this regular background.
-
void set_palette(const bg_
palette_ item& palette_item) - Replaces the color palette used by this regular background with a new one created with the given bg_
palette_ item. -
void set_tiles_and_palette(regular_
bg_ tiles_ ptr tiles, bg_ palette_ ptr palette) - Sets the tiles and the color palette to use by this regular background.
-
void set_tiles_and_palette(const regular_
bg_ tiles_ item& tiles_item, const bg_ palette_ item& palette_item) - Replaces the tiles and the color palette used by this regular background with the created with the given regular_
bg_ tiles_ item and bg_ palette_ item. -
auto map() const -> const regular_
bg_ map_ ptr& - Returns the map used by this regular background.
-
void set_map(const regular_
bg_ map_ ptr& map) - Sets the map used by this regular background.
-
void set_map(regular_
bg_ map_ ptr&& map) - Sets the map used by this regular background.
-
void set_map(const regular_
bg_ map_ item& map_item) - Replaces the map used by this regular background with a new map created with the given regular_
bg_ map_ item. -
void set_map(const regular_
bg_ map_ item& map_item, int map_index) - Replaces the map used by this regular background with a new map created with the given regular_
bg_ map_ item. -
void set_item(const regular_
bg_ item& item) - Replaces the tiles, the color palette and the map used by this regular background with the created with the given regular_
bg_ item. -
void set_item(const regular_
bg_ item& item, int map_index) - Replaces the tiles, the color palette and the map used by this regular background with the created with the given regular_
bg_ item. - auto x() const -> fixed
- Returns the horizontal position of the regular background (relative to its camera, if it has one).
- void set_x(fixed x)
- Sets the horizontal position of the regular background (relative to its camera, if it has one).
- auto y() const -> fixed
- Returns the vertical position of the regular background (relative to its camera, if it has one).
- void set_y(fixed y)
- Sets the vertical position of the regular background (relative to its camera, if it has one).
-
auto position() const -> const fixed_
point& - Returns the position of the regular background (relative to its camera, if it has one).
- void set_position(fixed x, fixed y)
- Sets the position of the regular background (relative to its camera, if it has one).
-
void set_position(const fixed_
point& position) - Sets the position of the regular background (relative to its camera, if it has one).
- auto top_left_x() const -> fixed
- Returns the horizontal top-left position of the regular 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 regular background (relative to its camera, if it has one).
- auto top_left_y() const -> fixed
- Returns the vertical top-left position of the regular 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 regular background (relative to its camera, if it has one).
-
auto top_left_position() const -> fixed_
point - Returns the top-left position of the regular 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 regular 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 regular background (relative to its camera, if it has one).
- auto priority() const -> int
- Returns the priority of the regular background relative to sprites and other backgrounds.
- void set_priority(int priority)
- Sets the priority of the regular background relative to sprites and other backgrounds.
- auto z_order() const -> int
- Returns the priority of the regular background relative to other backgrounds, excluding sprites.
- void set_z_order(int z_order)
- Sets the priority of the regular background relative to other backgrounds, excluding sprites.
- void put_above()
- Modify this regular background to be drawn above all of the other backgrounds with the same priority.
- void put_below()
- Modify this regular background to be drawn below all of the other backgrounds with the same priority.
- auto mosaic_enabled() const -> bool
- Indicates if the mosaic effect must be applied to this regular background or not.
- void set_mosaic_enabled(bool mosaic_enabled)
- Sets if the mosaic effect must be applied to this regular background or not.
- auto blending_enabled() const -> bool
- Indicates if blending must be applied to this regular background or not.
- void set_blending_enabled(bool blending_enabled)
- Sets if blending must be applied to this regular background or not.
- auto blending_top_enabled() const -> bool
- Indicates if this regular background is part of the blending top layer or not.
- void set_blending_top_enabled(bool blending_top_enabled)
- Sets if this regular background is part of the blending top layer or not.
- auto blending_bottom_enabled() const -> bool
- Indicates if this regular background is part of the blending bottom layer or not.
- void set_blending_bottom_enabled(bool blending_bottom_enabled)
- Sets if this regular background is part of the blending bottom layer or not.
-
auto green_swap_mode() const -> bn::
green_swap_mode - Indicates how this regular background must be displayed when green swap is enabled.
-
void set_green_swap_mode(bn::
green_swap_mode green_swap_mode) - Sets how this regular background must be displayed when green swap is enabled.
- auto visible() const -> bool
- Indicates if this regular background must be committed to the GBA or not.
- void set_visible(bool visible)
- Sets if this regular background must be committed to the GBA or not.
- auto visible_in_window(const window& window) const -> bool
- Indicates if this regular background is visible in the given window or not.
- void set_visible_in_window(bool visible, window& window)
- Sets if this regular background must be visible in the given window or not.
-
auto camera() const -> const optional<camera_
ptr>& - Returns the camera_
ptr attached to this regular background (if any). -
void set_camera(const camera_
ptr& camera) - Sets the camera_
ptr attached to this regular background. -
void set_camera(camera_
ptr&& camera) - Sets the camera_
ptr attached to this regular background. -
void set_camera(const optional<camera_
ptr>& camera) - Sets or removes the camera_
ptr attached to this regular background. -
void set_camera(optional<camera_
ptr>&& camera) - Sets or removes the camera_
ptr attached to this regular background. - void remove_camera()
- Removes the camera_
ptr attached to this regular background (if any). -
auto attributes() const -> regular_
bg_ attributes - Returns the attributes to commit to the GBA for this regular background.
-
void set_attributes(const regular_
bg_ attributes& attributes) - Sets the attributes to commit to the GBA for this regular 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(regular_
bg_ ptr& other) - Exchanges the contents of this regular_
bg_ ptr with those of the other one.
Friends
-
void swap(regular_
bg_ ptr& a, regular_ bg_ ptr& b) - Exchanges the contents of a regular_
bg_ ptr with those of another one. -
auto operator==(const regular_
bg_ ptr& a, const regular_ bg_ ptr& b) -> bool defaulted - Default equal operator.
Function documentation
static regular_ bg_ ptr bn:: regular_bg_ptr:: create(const regular_ bg_ item& item)
Creates a regular_
Parameters | |
---|---|
item | regular_ |
Returns | The requested regular_ |
static regular_ bg_ ptr bn:: regular_bg_ptr:: create(const regular_ bg_ item& item,
int map_index)
Creates a regular_
Parameters | |
---|---|
item | regular_ |
map_index | Index of the map to reference in item.map_item(). |
Returns | The requested regular_ |
static regular_ bg_ ptr bn:: regular_bg_ptr:: create(regular_ bg_ map_ ptr map)
Creates a regular_
Parameters | |
---|---|
map | regular_ |
Returns | The requested regular_ |
static regular_ bg_ ptr bn:: regular_bg_ptr:: create(fixed x,
fixed y,
const regular_ bg_ item& item)
Creates a regular_
Parameters | |
---|---|
x | Horizontal position of the regular background. |
y | Vertical position of the regular background. |
item | regular_ |
Returns | The requested regular_ |
static regular_ bg_ ptr bn:: regular_bg_ptr:: create(fixed x,
fixed y,
const regular_ bg_ item& item,
int map_index)
Creates a regular_
Parameters | |
---|---|
x | Horizontal position of the regular background. |
y | Vertical position of the regular background. |
item | regular_ |
map_index | Index of the map to reference in item.map_item(). |
Returns | The requested regular_ |
static regular_ bg_ ptr bn:: regular_bg_ptr:: create(const fixed_ point& position,
const regular_ bg_ item& item)
Creates a regular_
Parameters | |
---|---|
position | Position of the regular background. |
item | regular_ |
Returns | The requested regular_ |
static regular_ bg_ ptr bn:: regular_bg_ptr:: create(const fixed_ point& position,
const regular_ bg_ item& item,
int map_index)
Creates a regular_
Parameters | |
---|---|
position | Position of the regular background. |
item | regular_ |
map_index | Index of the map to reference in item.map_item(). |
Returns | The requested regular_ |
static regular_ bg_ ptr bn:: regular_bg_ptr:: create(fixed x,
fixed y,
regular_ bg_ map_ ptr map)
Creates a regular_
Parameters | |
---|---|
x | Horizontal position of the regular background. |
y | Vertical position of the regular background. |
map | regular_ |
Returns | The requested regular_ |
static regular_ bg_ ptr bn:: regular_bg_ptr:: create(const fixed_ point& position,
regular_ bg_ map_ ptr map)
Creates a regular_
Parameters | |
---|---|
position | Position of the regular background. |
map | regular_ |
Returns | The requested regular_ |
static regular_ bg_ ptr bn:: regular_bg_ptr:: create(const regular_ bg_ builder& builder)
Creates a regular_
Parameters | |
---|---|
builder | regular_ |
Returns | The requested regular_ |
static regular_ bg_ ptr bn:: regular_bg_ptr:: create(regular_ bg_ builder&& builder)
Creates a regular_
Parameters | |
---|---|
builder | regular_ |
Returns | The requested regular_ |
static optional<regular_ bg_ ptr> bn:: regular_bg_ptr:: create_optional(const regular_ bg_ item& item)
Creates a regular_
Parameters | |
---|---|
item | regular_ |
Returns | The requested regular_ |
static optional<regular_ bg_ ptr> bn:: regular_bg_ptr:: create_optional(const regular_ bg_ item& item,
int map_index)
Creates a regular_
Parameters | |
---|---|
item | regular_ |
map_index | Index of the map to reference in item.map_item(). |
Returns | The requested regular_ |
static optional<regular_ bg_ ptr> bn:: regular_bg_ptr:: create_optional(regular_ bg_ map_ ptr map)
Creates a regular_
Parameters | |
---|---|
map | regular_ |
Returns | The requested regular_ |
static optional<regular_ bg_ ptr> bn:: regular_bg_ptr:: create_optional(fixed x,
fixed y,
const regular_ bg_ item& item)
Creates a regular_
Parameters | |
---|---|
x | Horizontal position of the regular background. |
y | Vertical position of the regular background. |
item | regular_ |
Returns | The requested regular_ |
static optional<regular_ bg_ ptr> bn:: regular_bg_ptr:: create_optional(fixed x,
fixed y,
const regular_ bg_ item& item,
int map_index)
Creates a regular_
Parameters | |
---|---|
x | Horizontal position of the regular background. |
y | Vertical position of the regular background. |
item | regular_ |
map_index | Index of the map to reference in item.map_item(). |
Returns | The requested regular_ |
static optional<regular_ bg_ ptr> bn:: regular_bg_ptr:: create_optional(const fixed_ point& position,
const regular_ bg_ item& item)
Creates a regular_
Parameters | |
---|---|
position | Position of the regular background. |
item | regular_ |
Returns | The requested regular_ |
static optional<regular_ bg_ ptr> bn:: regular_bg_ptr:: create_optional(const fixed_ point& position,
const regular_ bg_ item& item,
int map_index)
Creates a regular_
Parameters | |
---|---|
position | Position of the regular background. |
item | regular_ |
map_index | Index of the map to reference in item.map_item(). |
Returns | The requested regular_ |
static optional<regular_ bg_ ptr> bn:: regular_bg_ptr:: create_optional(fixed x,
fixed y,
regular_ bg_ map_ ptr map)
Creates a regular_
Parameters | |
---|---|
x | Horizontal position of the regular background. |
y | Vertical position of the regular background. |
map | regular_ |
Returns | The requested regular_ |
static optional<regular_ bg_ ptr> bn:: regular_bg_ptr:: create_optional(const fixed_ point& position,
regular_ bg_ map_ ptr map)
Creates a regular_
Parameters | |
---|---|
position | Position of the regular background. |
map | regular_ |
Returns | The requested regular_ |
static optional<regular_ bg_ ptr> bn:: regular_bg_ptr:: create_optional(const regular_ bg_ builder& builder)
Creates a regular_
Parameters | |
---|---|
builder | regular_ |
Returns | The requested regular_ |
static optional<regular_ bg_ ptr> bn:: regular_bg_ptr:: create_optional(regular_ bg_ builder&& builder)
Creates a regular_
Parameters | |
---|---|
builder | regular_ |
Returns | The requested regular_ |
bn:: regular_bg_ptr:: regular_bg_ptr(const regular_ bg_ ptr& other)
Copy constructor.
Parameters | |
---|---|
other | regular_ |
bn:: regular_bg_ptr:: regular_bg_ptr(regular_ bg_ ptr&& other) noexcept
Move constructor.
Parameters | |
---|---|
other | regular_ |
regular_ bg_ ptr& bn:: regular_bg_ptr:: operator=(const regular_ bg_ ptr& other)
Copy assignment operator.
Parameters | |
---|---|
other | regular_ |
Returns | Reference to this. |
regular_ bg_ ptr& bn:: regular_bg_ptr:: operator=(regular_ bg_ ptr&& other) noexcept
Move assignment operator.
Parameters | |
---|---|
other | regular_ |
Returns | Reference to this. |
bool bn:: regular_bg_ptr:: big() const
Indicates if this regular background is big or not.
Big backgrounds are slower CPU wise, but can have any width or height multiple of 256 pixels.
void bn:: regular_bg_ptr:: set_tiles(const regular_ bg_ tiles_ ptr& tiles)
Sets the tiles used by this regular background.
Parameters | |
---|---|
tiles | regular_ |
It must be compatible with the current map of the regular background.
void bn:: regular_bg_ptr:: set_tiles(regular_ bg_ tiles_ ptr&& tiles)
Sets the tiles used by this regular background.
Parameters | |
---|---|
tiles | regular_ |
It must be compatible with the current map of the regular background.
void bn:: regular_bg_ptr:: set_tiles(const regular_ bg_ tiles_ item& tiles_item)
Replaces the tiles used by this regular background with a new tile set created with the given regular_
Parameters | |
---|---|
tiles_item | It creates the new background tiles to use by this regular background. |
Before creating a new background tile set, the regular_
The new background tiles must be compatible with the current map of the regular background.
void bn:: regular_bg_ptr:: set_palette(const bg_ palette_ ptr& palette)
Sets the color palette to use by this regular background.
Parameters | |
---|---|
palette | bg_ |
It must be compatible with the current map of the regular background.
void bn:: regular_bg_ptr:: set_palette(bg_ palette_ ptr&& palette)
Sets the color palette to use by this regular background.
Parameters | |
---|---|
palette | bg_ |
It must be compatible with the current map of the regular background.
void bn:: regular_bg_ptr:: set_palette(const bg_ palette_ item& palette_item)
Replaces the color palette used by this regular background with a new one created with the given bg_
Parameters | |
---|---|
palette_item | It creates the color palette to use by this regular background. |
Before creating a new color palette, the bg_
The new color palette must be compatible with the current map of the regular background.
void bn:: regular_bg_ptr:: set_tiles_and_palette(regular_ bg_ tiles_ ptr tiles,
bg_ palette_ ptr palette)
Sets the tiles and the color palette to use by this regular background.
Parameters | |
---|---|
tiles | regular_ |
palette | bg_ |
The given parameters must be compatible with the current map of the regular background.
void bn:: regular_bg_ptr:: set_tiles_and_palette(const regular_ bg_ tiles_ item& tiles_item,
const bg_ palette_ item& palette_item)
Replaces the tiles and the color palette used by this regular background with the created with the given regular_
Parameters | |
---|---|
tiles_item | It creates the new background tiles to use by this regular background. |
palette_item | It creates the color palette to use by this regular background. |
Before creating new resources, the resources used by this regular background are removed, so VRAM usage is reduced.
void bn:: regular_bg_ptr:: set_map(const regular_ bg_ map_ ptr& map)
Sets the map used by this regular background.
Parameters | |
---|---|
map | regular_ |
void bn:: regular_bg_ptr:: set_map(regular_ bg_ map_ ptr&& map)
Sets the map used by this regular background.
Parameters | |
---|---|
map | regular_ |
void bn:: regular_bg_ptr:: set_map(const regular_ bg_ map_ item& map_item)
Replaces the map used by this regular background with a new map created with the given regular_
Parameters | |
---|---|
map_item | It creates the new map to use by this regular background. |
Before creating a new map, the regular_
void bn:: regular_bg_ptr:: set_map(const regular_ bg_ map_ item& map_item,
int map_index)
Replaces the map used by this regular background with a new map created with the given regular_
Parameters | |
---|---|
map_item | It creates the new map to use by this regular background. |
map_index | Index of the map to reference in map_item. |
Before creating a new map, the regular_
void bn:: regular_bg_ptr:: set_item(const regular_ bg_ item& item)
Replaces the tiles, the color palette and the map used by this regular background with the created with the given regular_
Parameters | |
---|---|
item | It creates the resources to use by this regular background. |
Before creating new resources, the resources used by this regular background are removed, so VRAM usage is reduced.
void bn:: regular_bg_ptr:: set_item(const regular_ bg_ item& item,
int map_index)
Replaces the tiles, the color palette and the map used by this regular background with the created with the given regular_
Parameters | |
---|---|
item | It creates the resources to use by this regular background. |
map_index | Index of the map to reference in item.map_item(). |
Before creating new resources, the resources used by this regular background are removed, so VRAM usage is reduced.
void bn:: regular_bg_ptr:: set_position(fixed x,
fixed y)
Sets the position of the regular background (relative to its camera, if it has one).
Parameters | |
---|---|
x | Horizontal position of the regular background (relative to its camera, if it has one). |
y | Vertical position of the regular background (relative to its camera, if it has one). |
void bn:: regular_bg_ptr:: set_top_left_position(fixed top_left_x,
fixed top_left_y)
Sets the top-left position of the regular background (relative to its camera, if it has one).
Parameters | |
---|---|
top_left_x | Horizontal top-left position of the regular background (relative to its camera, if it has one). |
top_left_y | Vertical top-left position of the regular background (relative to its camera, if it has one). |
int bn:: regular_bg_ptr:: priority() const
Returns the priority of the regular 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:: regular_bg_ptr:: set_priority(int priority)
Sets the priority of the regular 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:: regular_bg_ptr:: z_order() const
Returns the priority of the regular 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:: regular_bg_ptr:: set_z_order(int z_order)
Sets the priority of the regular 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:: regular_bg_ptr:: blending_enabled() const
Indicates if blending must be applied to this regular background or not.
Blending is applied to this regular background by making it part of the blending top layer.
void bn:: regular_bg_ptr:: set_blending_enabled(bool blending_enabled)
Sets if blending must be applied to this regular background or not.
Blending is applied to this regular background by making it part of the blending top layer.
void bn:: regular_bg_ptr:: set_camera(const camera_ ptr& camera)
Sets the camera_
Parameters | |
---|---|
camera | camera_ |
void bn:: regular_bg_ptr:: set_camera(camera_ ptr&& camera)
Sets the camera_
Parameters | |
---|---|
camera | camera_ |
void bn:: regular_bg_ptr:: set_camera(const optional<camera_ ptr>& camera)
Sets or removes the camera_
Parameters | |
---|---|
camera | Optional camera_ |
void bn:: regular_bg_ptr:: set_camera(optional<camera_ ptr>&& camera)
Sets or removes the camera_
Parameters | |
---|---|
camera | Optional camera_ |
optional<int> bn:: regular_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:: regular_bg_ptr:: swap(regular_ bg_ ptr& other)
Exchanges the contents of this regular_
Parameters | |
---|---|
other | regular_ |
void swap(regular_ bg_ ptr& a,
regular_ bg_ ptr& b)
Exchanges the contents of a regular_
Parameters | |
---|---|
a | First regular_ |
b | Second regular_ |