pub struct Display<Api = Default>(/* private fields */);Implementations§
Source§impl Display<Default>
impl Display<Default>
Sourcepub fn Default() -> Self
pub fn Default() -> Self
Creates default Display without type parameter requirement.
Uses ZST api::Default.
Source§impl Display<Cache>
impl Display<Cache>
Sourcepub fn Cached() -> Self
pub fn Cached() -> Self
Creates Display without type parameter requirement.
Uses api::Cache.
Source§impl<Api: Api> Display<Api>
impl<Api: Api> Display<Api>
Sourcepub fn width(&self) -> c_int
pub fn width(&self) -> c_int
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.
See also Display::COLUMNS.
Equivalent to sys::ffi::playdate_display::getWidth
Sourcepub fn height(&self) -> c_int
pub fn height(&self) -> c_int
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.
See also Display::ROWS and Display::ROW_SIZE.
Equivalent to sys::ffi::playdate_display::getHeight
Sourcepub fn set_refresh_rate(&self, rate: c_float)
pub fn set_refresh_rate(&self, rate: c_float)
Sets the nominal refresh rate in frames per second.
Default is 20 fps, the maximum rate supported by the hardware for full-frame updates.
Equivalent to sys::ffi::playdate_display::setRefreshRate
Sourcepub fn set_inverted(&self, value: bool)
pub fn set_inverted(&self, value: bool)
If value is true, the frame buffer is drawn inverted—black instead of white, and vice versa.
Equivalent to sys::ffi::playdate_display::setInverted
Sourcepub fn set_scale(&self, scale: DisplayScale)
pub fn set_scale(&self, scale: DisplayScale)
Sets the display scale factor.
The top-left corner of the frame buffer is scaled up to fill the display;
e.g., if the scale is set to DisplayScale::Quad,
the pixels in rectangle [0, 100] x [0, 60] are drawn on the screen as 4 x 4 squares.
Equivalent to sys::ffi::playdate_display::setScale
Sourcepub fn set_scale_raw(&self, scale: c_uint)
pub fn set_scale_raw(&self, scale: c_uint)
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.
See also Display::set_scale.
Equivalent to sys::ffi::playdate_display::setScale
Sourcepub fn set_mosaic(&self, x: c_uint, y: c_uint)
pub fn set_mosaic(&self, x: c_uint, y: c_uint)
Adds a mosaic effect to the display.
Valid x and y values are between 0 and 3, inclusive.
Equivalent to sys::ffi::playdate_display::setMosaic
Sourcepub fn set_flipped(&self, x: bool, y: bool)
pub fn set_flipped(&self, x: bool, y: bool)
Flips the display on the x or y axis, or both.
Equivalent to sys::ffi::playdate_display::setFlipped
Sourcepub fn set_offset(&self, x: c_int, y: c_int)
pub fn set_offset(&self, x: c_int, y: c_int)
Offsets the display by the given amount.
Areas outside of the displayed area are filled with the current background color.
See also [playdate-graphics::set_background_color].
Equivalent to sys::ffi::playdate_display::setOffset
Trait Implementations§
impl<Api: Copy> Copy for Display<Api>
Auto Trait Implementations§
impl<Api> Freeze for Display<Api>where
Api: Freeze,
impl<Api> RefUnwindSafe for Display<Api>where
Api: RefUnwindSafe,
impl<Api> Send for Display<Api>where
Api: Send,
impl<Api> Sync for Display<Api>where
Api: Sync,
impl<Api> Unpin for Display<Api>where
Api: Unpin,
impl<Api> UnwindSafe for Display<Api>where
Api: UnwindSafe,
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
§impl<T> ToOwned for Twhere
T: Clone,
impl<T> ToOwned for Twhere
T: Clone,
§impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.