pub struct BackgroundControlValue(/* private fields */);
Expand description
Lets you adjust how each background layer is displayed.
The effects of setting a BackgroundControlValue
only apply in
VideoMode
0, 1, and 2, and also the specific layer must be present in
that video mode (eg: changing the BG0 control while in VideoMode2 has no
effect).
priority
: Determines the “z-order” of the background layers. When drawing a background pixel, the background layer with the lowest priority value non-transparent pixel gets its pixel drawn. If two BG layers have the same priority value set then the lower numbered background wins. Also note that the OBJ layer is part of this same calculation.char_base_block
: This determines the character base block for all tile ID offsets used by this background layer’s tile map.mosaic
: If this background layer should have the “mosaic” effect enabled.bpp8
: If the background should use use 8 bits per pixel (otherwise it uses 4 bits per pixel).screen_base_block
: Determines the tile map to use for arranging this background’s tiles.affine_wrap
: This causes the display area overflow to wrap when the layer is in affine mode, otherwise the display area is transparent. Has no effect on text mode backgrounds.screen_size
: This value affects the size of the background, but the details depend on if the background is in text mode or affine mode.
Screen Size | Text Mode (px) | Affine Mode (px) |
---|---|---|
0 | 256^2 | 128^2 |
1 | 512x256 (wide) | 256^2 |
2 | 256x512 (tall) | 512^2 |
3 | 512^2 | 1024^2 |
Implementations§
Source§impl BackgroundControlValue
impl BackgroundControlValue
pub const fn new() -> Self
pub const fn priority(self) -> u16
pub const fn with_priority(self, u: u16) -> Self
pub fn set_priority(&mut self, u: u16)
pub const fn char_base_block(self) -> u16
pub const fn with_char_base_block(self, u: u16) -> Self
pub fn set_char_base_block(&mut self, u: u16)
pub const fn mosaic(self) -> bool
pub const fn with_mosaic(self, b: bool) -> Self
pub fn set_mosaic(&mut self, b: bool)
pub const fn bpp8(self) -> bool
pub const fn with_bpp8(self, b: bool) -> Self
pub fn set_bpp8(&mut self, b: bool)
pub const fn screen_base_block(self) -> u16
pub const fn with_screen_base_block(self, u: u16) -> Self
pub fn set_screen_base_block(&mut self, u: u16)
pub const fn affine_wrap(self) -> bool
pub const fn with_affine_wrap(self, b: bool) -> Self
pub fn set_affine_wrap(&mut self, b: bool)
pub const fn screen_size(self) -> u16
pub const fn with_screen_size(self, u: u16) -> Self
pub fn set_screen_size(&mut self, u: u16)
Trait Implementations§
Source§impl Clone for BackgroundControlValue
impl Clone for BackgroundControlValue
Source§fn clone(&self) -> BackgroundControlValue
fn clone(&self) -> BackgroundControlValue
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for BackgroundControlValue
impl Debug for BackgroundControlValue
Source§impl Default for BackgroundControlValue
impl Default for BackgroundControlValue
Source§fn default() -> BackgroundControlValue
fn default() -> BackgroundControlValue
Returns the “default value” for a type. Read more
Source§impl PartialEq for BackgroundControlValue
impl PartialEq for BackgroundControlValue
impl Copy for BackgroundControlValue
impl Eq for BackgroundControlValue
impl StructuralPartialEq for BackgroundControlValue
Auto Trait Implementations§
impl Freeze for BackgroundControlValue
impl RefUnwindSafe for BackgroundControlValue
impl Send for BackgroundControlValue
impl Sync for BackgroundControlValue
impl Unpin for BackgroundControlValue
impl UnwindSafe for BackgroundControlValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more