[][src]Struct pix_engine::StateData

pub struct StateData { /* fields omitted */ }

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() -> Image[src]

pub fn get_draw_target(&self) -> ImageRef[src]

Returns a reference to the active draw target

panics if draw_target is not cleared properly and references an invalid target

pub fn set_draw_target(&mut self, target: ImageRef)[src]

Specify which image should be the target for draw functions

Note you must call clear_draw_target when finished. otherwise get_draw_target will likely panic

pub fn get_draw_target_dims(&self) -> (u32, u32)[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]

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]

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]

pub fn fill_triangle(
    &mut self,
    x1: u32,
    y1: u32,
    x2: u32,
    y2: u32,
    x3: u32,
    y3: u32,
    p: Pixel
)
[src]

pub fn draw_image(&mut self, x: u32, y: u32, image: &Image)[src]

pub fn draw_partial_image(
    &mut self,
    x: u32,
    y: u32,
    ox: u32,
    oy: u32,
    w: u32,
    h: u32,
    image: &Image
)
[src]

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]

pub fn create_texture(
    &mut self,
    name: &'static str,
    color_type: ColorType,
    src: Rect,
    dst: Rect
) -> PixEngineResult<()>
[src]

pub fn create_window_texture(
    &mut self,
    window_id: u32,
    name: &'static str,
    color_type: ColorType,
    src: Rect,
    dst: Rect
) -> PixEngineResult<()>
[src]

pub fn copy_draw_target(&mut self, name: &str) -> PixEngineResult<()>[src]

pub fn copy_window_draw_target(
    &mut self,
    window_id: u32,
    name: &str
) -> PixEngineResult<()>
[src]

pub fn copy_texture(&mut self, name: &str, bytes: &[u8]) -> PixEngineResult<()>[src]

pub fn copy_window_texture(
    &mut self,
    window_id: u32,
    name: &str,
    bytes: &[u8]
) -> PixEngineResult<()>
[src]

pub fn open_window(
    &mut self,
    title: &'static str,
    width: u32,
    height: u32
) -> PixEngineResult<u32>
[src]

pub fn close_window(&mut self, window_id: u32)[src]

impl StateData[src]

pub fn draw_transform(&mut self, transform: &mut Transform, image: &Image)[src]

Draws a image using the transform matrix

impl StateData[src]

pub fn main_window_id(&self) -> WindowId[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]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,