[−][src]Struct pixel_engine::Window
Base struct of the library contains the function to draw onto the window's canvas
Fields
canv: Canvas<Window>
The canvas's Window, not realy useful
height: u32
The Window's height, if ever useful
width: u32
The Window's width, if ever useful
px_size: u32
The Window pixel ratio, "1 pixel = px_size pixels" on the physical screen
name: String
The Window name
Methods
impl Window
[src]
pub fn new(
canvas: Canvas<Window>,
w: u32,
h: u32,
pixel_size: u32,
name: String
) -> Window
[src]
canvas: Canvas<Window>,
w: u32,
h: u32,
pixel_size: u32,
name: String
) -> Window
Create a new window from arguments given
pub fn clear(&mut self, col: Color)
[src]
Fill the whole screen with color given
pub fn draw(&mut self, x: i32, y: i32, col: Color) -> Result<(), String>
[src]
Draw a pixel at x,y
pub fn fill_rect(
&mut self,
x: i32,
y: i32,
w: i32,
h: i32,
col: Color
) -> Result<(), String>
[src]
&mut self,
x: i32,
y: i32,
w: i32,
h: i32,
col: Color
) -> Result<(), String>
Draw a filled rectangle starting a x,y with size w,h
pub fn update(&mut self)
[src]
Update the window's canvas to show change
pub fn update_title(
&mut self,
title: &str,
frame_count: u64
) -> Result<(), String>
[src]
&mut self,
title: &str,
frame_count: u64
) -> Result<(), String>
Update the title of the window with format "{name} - {fps}fps"
Trait Implementations
Auto Trait Implementations
impl Unpin for Window
impl !Sync for Window
impl !Send for Window
impl !UnwindSafe for Window
impl !RefUnwindSafe for Window
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
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>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
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>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,