[−][src]Struct pixel_engine::Engine
Bone of the Engine, join everything;
Fields
title: String
Main title of the window, Window's full title will be "Title - fps"
size: (u32, u32, u32)
Size of the window, with (x-size,y-size,pixel-size)
elapsed: f64
Time between current frame and last frame, usefull for movement's calculations
Implementations
impl Engine
[src]
pub fn size(&self) -> (u32, u32)
[src]
Return the current Target size in pixel
pub fn get_key(&self, keycode: Keycodes) -> Input
[src]
Get The status of a key
pub fn get_mouse_btn(&self, btn: MouseBtn) -> Input
[src]
Get the status of a Mouse Button
pub fn get_mouse_location(&self) -> (u32, u32)
[src]
Get the mouse location (in pixel) on the screen Will be defaulted to (0,0) at the start of the program
pub fn get_mouse_wheel(&self) -> MouseWheel
[src]
Get the scroll wheel direction (If Any) during the frame
pub fn get_pressed(&self) -> HashSet<Keycodes>
[src]
Get all Keys pressed during the last frame
pub fn create_decal(&mut self, sprite: &Sprite) -> Decal
[src]
Create a GPU version of Sprite
pub fn destroy_decal(&mut self, decal: Decal)
[src]
Tell the GPU to destroy everything related to that [Decal
]
Trait Implementations
impl Debug for Engine
[src]
impl DecalDraw for Engine
[src]
fn draw_decal_scaled<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
scale: P
)
[src]
&mut self,
pos: P,
decal: &Decal,
scale: P
)
fn draw_decal<P: Into<Vf2d> + Copy>(&mut self, pos: P, decal: &Decal)
[src]
fn draw_partial_decal<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
source_pos: P,
source_size: P
)
[src]
&mut self,
pos: P,
decal: &Decal,
source_pos: P,
source_size: P
)
fn draw_partial_decal_scaled<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
source_pos: P,
source_size: P,
scale: P
)
[src]
&mut self,
pos: P,
decal: &Decal,
source_pos: P,
source_size: P,
scale: P
)
fn draw_warped_decal<P: Into<Vf2d> + Copy>(
&mut self,
pos: [P; 4],
decal: &Decal
)
[src]
&mut self,
pos: [P; 4],
decal: &Decal
)
fn draw_warped_partial_decal<P: Into<Vf2d> + Copy>(
&mut self,
pos: [P; 4],
source_pos: P,
source_size: P,
decal: &Decal
)
[src]
&mut self,
pos: [P; 4],
source_pos: P,
source_size: P,
decal: &Decal
)
fn draw_explicit_decal<P: Into<Vf2d> + Copy>(
&mut self,
pos: [P; 4],
uv: [P; 4],
decal: &Decal
)
[src]
&mut self,
pos: [P; 4],
uv: [P; 4],
decal: &Decal
)
fn draw_rotated_decal<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
angle: f32,
center: P
)
[src]
&mut self,
pos: P,
decal: &Decal,
angle: f32,
center: P
)
fn draw_rotated_decal_scaled<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
angle: f32,
center: P,
scale: P
)
[src]
&mut self,
pos: P,
decal: &Decal,
angle: f32,
center: P,
scale: P
)
fn draw_partial_rotated_decal<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
angle: f32,
center: P,
source_pos: P,
source_size: P
)
[src]
&mut self,
pos: P,
decal: &Decal,
angle: f32,
center: P,
source_pos: P,
source_size: P
)
fn draw_partial_rotated_decal_scaled<P: Into<Vf2d> + Copy>(
&mut self,
pos: P,
decal: &Decal,
angle: f32,
center: P,
source_pos: P,
source_size: P,
scaled: P
)
[src]
&mut self,
pos: P,
decal: &Decal,
angle: f32,
center: P,
source_pos: P,
source_size: P,
scaled: P
)
impl ScreenTrait for Engine
[src]
fn get_size(&self) -> (u32, u32)
[src]
fn clear(&mut self, col: Color)
[src]
fn get_textsheet(&self) -> &Sprite
[src]
fn draw<P: Into<Vu2d>>(&mut self, pos: P, col: Color)
[src]
fn get_pixel_mode(&self) -> PixelMode
[src]
fn set_pixel_mode(&mut self, mode: PixelMode)
[src]
fn get_pixel<P: Into<Vu2d>>(&self, pos: P) -> Color
[src]
fn get_blend_factor(&self) -> f32
[src]
fn set_blend_factor(&mut self, f: f32)
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Engine
impl !Send for Engine
impl !Sync for Engine
impl Unpin for Engine
impl !UnwindSafe for Engine
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T> ShapesTrait for T where
T: ScreenTrait,
[src]
T: ScreenTrait,
fn draw_text<P>(&mut self, pos: P, scale: u32, col: Color, text: &str) where
P: Into<Vec2d<u32>>,
[src]
P: Into<Vec2d<u32>>,
fn draw_line<P>(&mut self, p1: P, p2: P, col: Color) where
P: Into<Vec2d<u32>>,
[src]
P: Into<Vec2d<u32>>,
fn draw_rect<P>(&mut self, pos: P, size: P, col: Color) where
P: Into<Vec2d<u32>>,
[src]
P: Into<Vec2d<u32>>,
fn fill_rect<P>(&mut self, pos: P, size: P, col: Color) where
P: Into<Vec2d<u32>>,
[src]
P: Into<Vec2d<u32>>,
fn draw_circle<P>(&mut self, pos: P, r: u32, col: Color) where
P: Into<Vec2d<u32>>,
[src]
P: Into<Vec2d<u32>>,
fn fill_circle<P>(&mut self, pos: P, r: u32, col: Color) where
P: Into<Vec2d<u32>>,
[src]
P: Into<Vec2d<u32>>,
fn draw_triangle<P>(&mut self, pts1: P, pts2: P, pts3: P, col: Color) where
P: Into<Vec2d<u32>>,
[src]
P: Into<Vec2d<u32>>,
fn fill_triangle<P>(&mut self, pts1: P, pts2: P, pts3: P, col: Color) where
P: Into<Vec2d<u32>>,
[src]
P: Into<Vec2d<u32>>,
impl<T> SpriteTrait for T where
T: ScreenTrait,
[src]
T: ScreenTrait,
fn draw_sprite<P>(
&mut self,
pos: P,
scale: u32,
sprite: &Sprite,
flip: (bool, bool)
) where
P: Into<Vec2d<u32>>,
[src]
&mut self,
pos: P,
scale: u32,
sprite: &Sprite,
flip: (bool, bool)
) where
P: Into<Vec2d<u32>>,
fn draw_partial_sprite<P>(
&mut self,
coords: P,
sprite: &Sprite,
o: P,
size: P,
scale: u32,
flip: (bool, bool)
) where
P: Into<Vec2d<u32>>,
[src]
&mut self,
coords: P,
sprite: &Sprite,
o: P,
size: P,
scale: u32,
flip: (bool, bool)
) where
P: Into<Vec2d<u32>>,
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>,