PlaydateDisplay

Struct PlaydateDisplay 

Source
pub struct PlaydateDisplay { /* private fields */ }

Implementations§

Source§

impl PlaydateDisplay

Source

pub fn get_width(&self) -> u32

Returns the height of the display, taking the current scale into account; e.g., if the scale is 2, this function returns 120 instead of 240.

Source

pub fn get_height(&self) -> u32

Returns the width of the display, taking the current scale into account; e.g., if the scale is 2, this function returns 200 instead of 400.

Source

pub fn set_refresh_rate(&self, rate: f32)

Sets the nominal refresh rate in frames per second. Default is 20 fps, the maximum rate supported by the hardware for full-frame updates.

Source

pub fn set_inverted(&self, flag: bool)

If flag evaluates to true, the frame buffer is drawn inverted—black instead of white, and vice versa.

Source

pub fn set_scale(&self, s: u32)

Sets the display scale factor. Valid values for scale are 1, 2, 4, and 8.

The top-left corner of the frame buffer is scaled up to fill the display; e.g., if the scale is set to 4, the pixels in rectangle [0,100] x [0,60] are drawn on the screen as 4 x 4 squares.

Source

pub fn set_mosaic(&self, effect: Vec2<u32>)

Adds a mosaic effect to the display. Valid x and y values are between 0 and 3, inclusive.

Source

pub fn set_flipped(&self, x: bool, y: bool)

Flips the display on the x or y axis, or both.

Source

pub fn set_offset(&self, delta: Vec2<i32>)

Offsets the display by the given amount. Areas outside of the displayed area are filled with the current background color.

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.