Struct agb::display::tiled0::Background [−][src]
#[non_exhaustive]pub struct Background { /* fields omitted */ }
Expand description
The map background is the method of drawing game maps to the screen. It automatically handles copying the correct portion of a provided map to the assigned block depending on given coordinates.
Implementations
Sets the background to be shown on screen. Requires the background to have a map enabled otherwise a panic is caused.
Hides the background, nothing from this background is rendered to screen.
Sets priority of the background layer. Backgrounds with higher priority are drawn (above/below) backgrounds with lower priority.
Forces the portion of the map in current view to be copied to the map block assigned to this background. This is currently unnecesary to call. Setting position already updates the drawn map, and changing map forces an update.
Forces a specific area of the screen to be drawn, taking into account any positonal offsets.
pub fn set_position(
&mut self,
map: &[u16],
dimensions: Vector2D<u32>,
position: Vector2D<i32>,
default: u16
)
pub fn set_position(
&mut self,
map: &[u16],
dimensions: Vector2D<u32>,
position: Vector2D<i32>,
default: u16
)
Sets the position of the map to be shown on screen. This automatically manages copying the correct portion to the map block and moving the map registers.