[−][src]Struct paddle::Display
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]
&'a mut self,
draw: &impl Tessellate,
bkg: impl Into<Background<'a>>,
trans: Transform,
z: i16
)
pub fn draw_mesh_ex(&mut self, mesh: &AbstractMesh, t: Transform, z: i16)
[src]
Trait Implementations
impl Into<DisplayArea> for Display
[src]
pub fn into(self) -> DisplayArea
[src]
Auto Trait Implementations
impl RefUnwindSafe for Display
[src]
impl !Send for Display
[src]
impl !Sync for Display
[src]
impl Unpin for Display
[src]
impl UnwindSafe for Display
[src]
Blanket Implementations
impl<T> Activity for T where
T: Any,
[src]
T: Any,
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,
pub 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.
pub 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.
pub 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>,