Ember

Struct Ember 

Source
pub struct Ember {
    pub width: i32,
    pub height: i32,
    /* private fields */
}

Fields§

§width: i32§height: i32

Implementations§

Source§

impl Ember

Source

pub fn new(title: &str, width: i32, height: i32, fps: f32) -> Self

Source

pub fn update(&mut self)

Source

pub fn set_pixel(&mut self, x: i32, y: i32, color: u32)

Source

pub fn draw_line(&mut self, x1: i32, y1: i32, x2: i32, y2: i32, color: u32)

Source

pub fn draw_line_width( &mut self, x0: i32, y0: i32, x1: i32, y1: i32, width: i32, color: u32, )

Source

pub fn draw_rectangle( &mut self, x: i32, y: i32, width: i32, height: i32, color: u32, )

Source

pub fn draw_rectangle_fill( &mut self, x: i32, y: i32, width: i32, height: i32, color: u32, )

Source

pub fn draw_circle(&mut self, x0: i32, y0: i32, radius: i32, color: u32)

Source

pub fn draw_circle_fill(&mut self, x0: i32, y0: i32, radius: i32, color: u32)

Source

pub fn draw_text(&mut self, text: &str, x: i32, y: i32, scale: i32, color: u32)

Source

pub fn get_keys(&mut self) -> Vec<Key>

Source

pub fn process_keys<F>(&mut self, f: F)
where F: FnMut(&Key),

Source

pub fn get_mouse_info(&self) -> MouseInfo

Source

pub fn should_close(&mut self) -> bool

Source

pub fn clear(&mut self)

Source

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

Auto Trait Implementations§

§

impl Freeze for Ember

§

impl !RefUnwindSafe for Ember

§

impl !Send for Ember

§

impl !Sync for Ember

§

impl Unpin for Ember

§

impl !UnwindSafe for Ember

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.