[][src]Struct rubidium::BackgroundControlValue

#[repr(transparent)]pub struct BackgroundControlValue(_);

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 SizeText Mode (px)Affine Mode (px)
0256^2128^2
1512x256 (wide)256^2
2256x512 (tall)512^2
3512^21024^2

Methods

impl BackgroundControlValue[src]

pub const fn new() -> Self[src]

#[must_use]pub const fn priority(self) -> u16[src]

#[must_use]pub const fn with_priority(self, u: u16) -> Self[src]

pub fn set_priority(&mut self, u: u16)[src]

#[must_use]pub const fn char_base_block(self) -> u16[src]

#[must_use]pub const fn with_char_base_block(self, u: u16) -> Self[src]

pub fn set_char_base_block(&mut self, u: u16)[src]

#[must_use]pub const fn mosaic(self) -> bool[src]

#[must_use]pub const fn with_mosaic(self, b: bool) -> Self[src]

pub fn set_mosaic(&mut self, b: bool)[src]

#[must_use]pub const fn bpp8(self) -> bool[src]

#[must_use]pub const fn with_bpp8(self, b: bool) -> Self[src]

pub fn set_bpp8(&mut self, b: bool)[src]

#[must_use]pub const fn screen_base_block(self) -> u16[src]

#[must_use]pub const fn with_screen_base_block(self, u: u16) -> Self[src]

pub fn set_screen_base_block(&mut self, u: u16)[src]

#[must_use]pub const fn affine_wrap(self) -> bool[src]

#[must_use]pub const fn with_affine_wrap(self, b: bool) -> Self[src]

pub fn set_affine_wrap(&mut self, b: bool)[src]

#[must_use]pub const fn screen_size(self) -> u16[src]

#[must_use]pub const fn with_screen_size(self, u: u16) -> Self[src]

pub fn set_screen_size(&mut self, u: u16)[src]

Trait Implementations

impl Clone for BackgroundControlValue[src]

impl Copy for BackgroundControlValue[src]

impl Debug for BackgroundControlValue[src]

impl Default for BackgroundControlValue[src]

impl Eq for BackgroundControlValue[src]

impl PartialEq<BackgroundControlValue> for BackgroundControlValue[src]

impl StructuralEq for BackgroundControlValue[src]

impl StructuralPartialEq for BackgroundControlValue[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.