[−][src]Struct pix_engine::StateData
Manages all engine state including graphics and inputs
Methods
impl StateData
[src]
pub fn enqueue_audio(&mut self, samples: &[f32])
[src]
impl StateData
[src]
pub fn construct_font() -> Sprite
[src]
pub fn get_draw_target(&mut self) -> &Sprite
[src]
pub fn get_draw_target_mut(&mut self) -> &mut Sprite
[src]
pub fn set_draw_target(&mut self, target: &mut Sprite)
[src]
pub fn clear_draw_target(&mut self)
[src]
pub fn get_alpha_mode(&self) -> AlphaMode
[src]
pub fn set_alpha_mode(&mut self, mode: AlphaMode)
[src]
pub fn set_alpha_blend(&mut self, blend: f32)
[src]
pub fn enable_coord_wrapping(&mut self, val: bool)
[src]
pub fn get_draw_color(&mut self) -> Pixel
[src]
pub fn set_draw_color(&mut self, p: Pixel)
[src]
pub fn reset_draw_color(&mut self)
[src]
pub fn set_draw_scale(&mut self, scale: u32)
[src]
pub fn wrap_coords(&self, x: f32, y: f32, ox: &mut f32, oy: &mut f32)
[src]
pub fn fill(&mut self, p: Pixel)
[src]
pub fn clear(&mut self)
[src]
pub fn draw(&mut self, x: u32, y: u32, p: Pixel)
[src]
pub fn draw_line(&mut self, x1: u32, y1: u32, x2: u32, y2: u32, p: Pixel)
[src]
pub fn draw_line_i32(&mut self, x1: i32, y1: i32, x2: i32, y2: i32, p: Pixel)
[src]
pub fn draw_line_pattern(
&mut self,
x1: u32,
y1: u32,
x2: u32,
y2: u32,
pattern: u32,
p: Pixel
)
[src]
&mut self,
x1: u32,
y1: u32,
x2: u32,
y2: u32,
pattern: u32,
p: Pixel
)
pub fn draw_circle(&mut self, x: u32, y: u32, r: u32, p: Pixel)
[src]
pub fn draw_partial_circle(
&mut self,
x: u32,
y: u32,
r: u32,
mask: u8,
p: Pixel
)
[src]
&mut self,
x: u32,
y: u32,
r: u32,
mask: u8,
p: Pixel
)
pub fn fill_circle(&mut self, x: u32, y: u32, r: u32, p: Pixel)
[src]
pub fn draw_elipse(&mut self, _p: Pixel)
[src]
pub fn fill_elipse(&mut self, _p: Pixel)
[src]
pub fn draw_rect(&mut self, x: u32, y: u32, w: u32, h: u32, p: Pixel)
[src]
pub fn fill_rect(&mut self, x: u32, y: u32, w: u32, h: u32, p: Pixel)
[src]
pub fn draw_triangle(
&mut self,
x1: u32,
y1: u32,
x2: u32,
y2: u32,
x3: u32,
y3: u32,
p: Pixel
)
[src]
&mut self,
x1: u32,
y1: u32,
x2: u32,
y2: u32,
x3: u32,
y3: u32,
p: Pixel
)
pub fn fill_triangle(
&mut self,
x1: u32,
y1: u32,
x2: u32,
y2: u32,
x3: u32,
y3: u32,
p: Pixel
)
[src]
&mut self,
x1: u32,
y1: u32,
x2: u32,
y2: u32,
x3: u32,
y3: u32,
p: Pixel
)
pub fn draw_sprite(&mut self, x: u32, y: u32, sprite: &Sprite)
[src]
pub fn draw_partial_sprite(
&mut self,
x: u32,
y: u32,
ox: u32,
oy: u32,
w: u32,
h: u32,
sprite: &Sprite
)
[src]
&mut self,
x: u32,
y: u32,
ox: u32,
oy: u32,
w: u32,
h: u32,
sprite: &Sprite
)
pub fn draw_string(&mut self, x: u32, y: u32, text: &str, p: Pixel)
[src]
pub fn draw_wireframe(
&mut self,
model_coords: &[(f32, f32)],
x: f32,
y: f32,
angle: f32,
scale: f32,
p: Pixel
)
[src]
&mut self,
model_coords: &[(f32, f32)],
x: f32,
y: f32,
angle: f32,
scale: f32,
p: Pixel
)
pub fn create_texture(
&mut self,
window_id: u32,
name: &'static str,
color_type: ColorType,
src: Rect,
dst: Rect
) -> PixEngineResult<()>
[src]
&mut self,
window_id: u32,
name: &'static str,
color_type: ColorType,
src: Rect,
dst: Rect
) -> PixEngineResult<()>
pub fn copy_draw_target(
&mut self,
window_id: u32,
name: &str
) -> PixEngineResult<()>
[src]
&mut self,
window_id: u32,
name: &str
) -> PixEngineResult<()>
pub fn copy_texture(
&mut self,
window_id: u32,
name: &str,
bytes: &[u8]
) -> PixEngineResult<()>
[src]
&mut self,
window_id: u32,
name: &str,
bytes: &[u8]
) -> PixEngineResult<()>
pub fn open_window(
&mut self,
title: &'static str,
width: u32,
height: u32
) -> PixEngineResult<u32>
[src]
&mut self,
title: &'static str,
width: u32,
height: u32
) -> PixEngineResult<u32>
pub fn close_window(&mut self, window_id: u32)
[src]
impl StateData
[src]
pub fn draw_transform(&mut self, transform: &mut Transform, sprite: &Sprite)
[src]
Draws a sprite using the transform matrix
impl StateData
[src]
pub fn main_window(&self) -> u32
[src]
Engine attributes ======================================================
pub fn title(&self) -> &str
[src]
Custom title to append in the window
pub fn set_title(&mut self, title: &str)
[src]
Set a custom title to append
pub fn fullscreen(&mut self, val: bool) -> PixEngineResult<()>
[src]
Toggle fullscreen
pub fn vsync(&mut self, val: bool) -> PixEngineResult<()>
[src]
Toggle vsync
pub fn screen_width(&self) -> u32
[src]
Screen Width
pub fn screen_height(&self) -> u32
[src]
Screen Height
pub fn set_screen_size(
&mut self,
width: u32,
height: u32
) -> PixEngineResult<()>
[src]
&mut self,
width: u32,
height: u32
) -> PixEngineResult<()>
Change screen dimensions.
pub fn is_focused(&self) -> bool
[src]
Whether window has focus
pub fn get_key(&self, key: Key) -> Input
[src]
Get the state of a specific keyboard button
pub fn get_mouse(&self, button: Mouse) -> Input
[src]
Get the state of a specific mouse buton
pub fn get_mouse_x(&self) -> i32
[src]
Get Mouse X-coord in screen space
pub fn get_mouse_y(&self) -> i32
[src]
Get Mouse Y-coord in screen space
pub fn get_mouse_wheel(&self) -> i32
[src]
Get Mouse wheel data
pub fn poll(&mut self) -> Vec<PixEvent>
[src]
pub fn is_inside_circle(&self, cx: f32, cy: f32, r: f32, x: f32, y: f32) -> bool
[src]
Utility functions ====================================================== Collision detection for basic circle shapes Detects whether point (x, y) lies inside circle of radius r located at (cx, cy)
Auto Trait Implementations
impl !RefUnwindSafe for StateData
impl !Send for StateData
impl !Sync for StateData
impl Unpin for StateData
impl !UnwindSafe for StateData
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, 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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,