[][src]Struct paddle::Display

pub struct Display { /* fields omitted */ }

An object to manage the full display area for your game inside the browser.

The Display object is responsible for putting stuff to see in front of the user and nothing else. It also includes configuration options, such as GPU settings.

Implementations

impl Display[src]

pub fn from_domain(domain: &mut DomainState) -> &mut Self[src]

impl Display[src]

pub fn browser_region(&self) -> Rectangle[src]

Position relative to browser page and size in browser pixels

pub fn resolution(&self) -> Vector[src]

How many pixels are rendered in the Canvas

pub fn clear(&mut self)[src]

pub fn game_to_browser_coordinates(&self) -> Transform[src]

Transforms from coordinates used inside the game (aka world coordinates) to browser coordinates (as used by e.g. CSS pixels)

pub fn browser_to_game_pixel_ratio(&self) -> f32[src]

Gives result for x axis (assuming y is the same)

pub fn fit_to_visible_area(&mut self, margin: f64) -> PaddleResult<()>[src]

Fixed to 16:9 ratio for now

pub fn adjust_display(&mut self) -> PaddleResult<()>[src]

Look up size and position of canvas in the browser and update input and drawing transformations accordingly. This should be called after the canvas size has changed, for example when the window is resized. When calling fit_to_visible_area(), the display is adjusted automatically (no need to call adjust_display() manually).

pub fn draw_ex<'a>(
    &'a mut self,
    draw: &impl Tessellate,
    bkg: impl Into<Background<'a>>,
    trans: Transform,
    z: i16
)
[src]

pub fn draw_mesh_ex(&mut self, mesh: &AbstractMesh, t: Transform, z: i16)[src]

Trait Implementations

impl Into<DisplayArea> for Display[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Activity for T where
    T: Any
[src]

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>,