Struct adi_screen::Window
[−]
[src]
pub struct Window { pub vw: Vw, pub window: NativeWindow, pub sprites: Vec<Shape>, pub input: Vec<Input>, pub joystick: Joystick, // some fields omitted }
Window represents a connection to a display that can also recieve input.
Fields
vw: Vw
window: NativeWindow
sprites: Vec<Shape>
input: Vec<Input>
joystick: Joystick
Methods
impl Window
[src]
fn create(name: &str, icon: &'static [u8], shaders: &[Shader]) -> Window
Create a window for drawing to. name is the name of the window. icon is the window's icon in ppm format. shaders is a list of custom shaders.
fn background(&mut self, r: f32, g: f32, b: f32)
Set the background color of the window.
fn unit_size(&self) -> (f32, f32)
Get the minimal x and y dimension for a widget.
fn update(&mut self) -> Input
Update the window and return the user input. This should run in a loop.
fn pulse_half_linear(&self, rate_spr: f32) -> f32
Returns a number between 0-1. This function is used for animations. It will take rate_spr seconds to go from 0 to 1.
fn pulse_full_linear(&self, rate_spr: f32) -> f32
Returns a number between 0-1. This function is used for animations. It will take rate_spr seconds to go from 0 to 1 and back to 0.
fn pulse_half_smooth(&self, rate_spr: f32) -> f32
Returns a number between 0-1. This function is used for animations. It will take rate_spr seconds to go from 0 to 1. It uses cosine underneath to make the animation look smooth, by making the beginning and end of the animation slower than the middle.
fn pulse_full_smooth(&self, rate_spr: f32) -> f32
Returns a number between 0-1. This function is used for animations. It will take rate_spr seconds to go from 0 to 1 and back to 0. It uses cosine underneath to make the animation look smooth, by making the beginning and end of the animation slower than the middle.