Struct simple_pixels::Context

source ·
pub struct Context<'a> { /* private fields */ }

Implementations§

source§

impl<'a> Context<'a>

source

pub fn width(&self) -> u32

source

pub fn height(&self) -> u32

source

pub fn dpi_scale(&self) -> f32

source

pub fn screen_size(&self) -> (f32, f32)

source

pub fn delta_time(&self) -> Duration

source

pub fn clear_color(&mut self, color: RGBA8)

source

pub fn get_key_state(&self, key: KeyCode) -> Option<InputState>

source

pub fn is_key_down(&self, key: KeyCode) -> bool

source

pub fn is_key_pressed(&self, key: KeyCode) -> bool

source

pub fn is_key_released(&self, key: KeyCode) -> bool

source

pub fn get_key_mods(&self) -> KeyMods

source

pub fn get_mouse_pos(&self) -> (f32, f32)

source

pub fn get_mouse_pos_int(&self) -> (i32, i32)

source

pub fn get_mouse_button_state(&self, button: MouseButton) -> Option<InputState>

source

pub fn is_mouse_button_down(&self, button: MouseButton) -> bool

source

pub fn is_mouse_button_pressed(&self, button: MouseButton) -> bool

source

pub fn is_mouse_button_released(&self, button: MouseButton) -> bool

source

pub fn quit(&mut self)

source

pub fn show_mouse(&mut self, shown: bool)

source

pub fn set_fullscreen(&mut self, fullscreen: bool)

source

pub fn get_clipboard(&mut self) -> Option<String>

source

pub fn set_clipboard(&mut self, data: &str)

source

pub fn clear(&mut self)

source

pub fn draw_pixel(&mut self, x: u32, y: u32, color: RGBA8)

source

pub fn draw_rect( &mut self, x: u32, y: u32, width: u32, height: u32, color: RGBA8 )

source

pub fn draw_pixels( &mut self, x: u32, y: u32, width: u32, height: u32, pixels: &[RGBA8] )

source

pub fn draw_screen(&mut self, pixels: &[RGBA8])

source

pub fn get_draw_buffer(&self) -> &[RGBA8]

source

pub fn get_mut_draw_buffer(&mut self) -> &mut [RGBA8]

source

pub fn set_filter_mode(&mut self, filter: FilterMode)

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Context<'a>

§

impl<'a> !Send for Context<'a>

§

impl<'a> !Sync for Context<'a>

§

impl<'a> Unpin for Context<'a>

§

impl<'a> !UnwindSafe for Context<'a>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.