Enum tetra::graphics::scaling::ScreenScaling
source · pub enum ScreenScaling {
None,
Stretch,
ShowAll,
ShowAllPixelPerfect,
Crop,
CropPixelPerfect,
Resize,
}
Expand description
Defines the different ways that a game’s screen can be scaled.
Variants§
None
The game will always be displayed at its native resolution, with no scaling applied. If the window is bigger than the native resolution, letterboxing will be applied. If the window is smaller than the native resolution, it will be cropped.
Stretch
The screen will be stretched to fill the window, without trying to preserve the original aspect ratio. Distortion/stretching/squashing may occur.
ShowAll
The entire screen will be displayed as large as possible while maintaining the original aspect ratio. Letterboxing may occur.
ShowAllPixelPerfect
Works the same as ShowAll, but will only scale by integer values.
Crop
The screen will fill the entire window, maintaining the original aspect ratio but potentially being cropped.
CropPixelPerfect
Works the same as Crop, but will only scale by integer values.
Resize
The screen will resize to match the size of the window. More of the scene will be shown on bigger windows, and less of the scene will be shown on smaller windows.
If the scaling mode changes, the internal resolution will return to its original value.
Trait Implementations§
source§impl Clone for ScreenScaling
impl Clone for ScreenScaling
source§fn clone(&self) -> ScreenScaling
fn clone(&self) -> ScreenScaling
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ScreenScaling
impl Debug for ScreenScaling
source§impl PartialEq<ScreenScaling> for ScreenScaling
impl PartialEq<ScreenScaling> for ScreenScaling
source§fn eq(&self, other: &ScreenScaling) -> bool
fn eq(&self, other: &ScreenScaling) -> bool
impl Copy for ScreenScaling
impl StructuralPartialEq for ScreenScaling
Auto Trait Implementations§
impl RefUnwindSafe for ScreenScaling
impl Send for ScreenScaling
impl Sync for ScreenScaling
impl Unpin for ScreenScaling
impl UnwindSafe for ScreenScaling
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> SetParameter for T
impl<T> SetParameter for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.