[][src]Enum quicksilver::graphics::ResizeHandler

#[non_exhaustive]pub enum ResizeHandler {
    Stretch,
    Maintain {
        width: f32,
        height: f32,
    },
    Fill {
        aspect_width: f32,
        aspect_height: f32,
    },
    Fit {
        aspect_width: f32,
        aspect_height: f32,
    },
    IntegerScale {
        aspect_width: u32,
        aspect_height: u32,
    },
}

The way to adjust the content when the size of the window changes

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Stretch

Use the entire area and stretch to fill it

Maintain

Keep the content area exactly the same size. If necessary, content will be cut off

Fields of Maintain

width: f32height: f32
Fill

Fill the screen while maintaing aspect ratio, possiby cutting off content in the process

Fields of Fill

aspect_width: f32aspect_height: f32
Fit

Take up as much of the screen as possible while maintaing aspect ratio, but use letterboxing if necessary

Fields of Fit

aspect_width: f32aspect_height: f32
IntegerScale

Only scale as integer multiple of the given width and height

16, 9, for example, will allow any 16:9 viewport; 160, 90 will only allow 16:9 viewports that are divisible by 10

Fields of IntegerScale

aspect_width: u32aspect_height: u32

Implementations

impl ResizeHandler[src]

pub fn content_size(self, size: Vector) -> Vector[src]

Determine the size of the content given a window size

This depends on which ResizeStrategy is in use; check the documentation for each enum variant for more.

Trait Implementations

impl Clone for ResizeHandler[src]

impl Copy for ResizeHandler[src]

impl Debug for ResizeHandler[src]

impl PartialEq<ResizeHandler> for ResizeHandler[src]

impl StructuralPartialEq for ResizeHandler[src]

Auto Trait Implementations

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.