Struct agb::display::bitmap3::Bitmap3

source ·
#[non_exhaustive]
pub struct Bitmap3<'gba> { /* private fields */ }

Implementations§

source§

impl Bitmap3<'_>

source

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);
    }
}
source

pub fn read_point(&self, x: i32, y: i32) -> u16

source

pub fn clear(&mut self, colour: u16)

Auto Trait Implementations§

§

impl<'gba> RefUnwindSafe for Bitmap3<'gba>

§

impl<'gba> Send for Bitmap3<'gba>

§

impl<'gba> Sync for Bitmap3<'gba>

§

impl<'gba> Unpin for Bitmap3<'gba>

§

impl<'gba> UnwindSafe for Bitmap3<'gba>

Blanket Implementations§

§

impl<T> Any for Twhere T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for Twhere U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.