#[non_exhaustive]pub struct Bitmap3<'gba> { /* private fields */ }
Implementations§
source§impl Bitmap3<'_>
impl Bitmap3<'_>
sourcepub fn draw_point(&mut self, x: i32, y: i32, colour: u16)
pub fn draw_point(&mut self, x: i32, y: i32, colour: u16)
Draws point to screen at (x, y) coordinates with colour and panics if (x, y) is out of the bounds of the screen.
Examples found in repository?
examples/multiple_video.rs (line 45)
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
fn bitmap3_mode(
bitmap: &mut display::bitmap3::Bitmap3,
vblank: &agb::interrupt::VBlank,
input: &mut agb::input::ButtonController,
) {
let mut pos = Vector2D {
x: display::WIDTH / 2,
y: display::HEIGHT / 2,
};
loop {
vblank.wait_for_vblank();
input.update();
if input.is_just_pressed(agb::input::Button::B) {
break;
}
pos.x += input.x_tri() as i32;
pos.y += input.y_tri() as i32;
pos.x = pos.x.clamp(0, display::WIDTH - 1);
pos.y = pos.y.clamp(0, display::HEIGHT - 1);
bitmap.draw_point(pos.x, pos.y, 0x001F);
}
}