pub enum SpriteFit {
Fit,
Cover,
Bottom,
}Expand description
Variants§
Fit
The canvas fits inside the window, centered, leaving margins on the shorter axis. UI elements keep their proportions and stay fully visible.
Cover
The canvas fills the window, centered, cropping the overflowing axis equally on both sides. Full-bleed stage imagery (scene backdrops, character portraits) reaches the window edges without distorting, and content anchored to a canvas edge stays flush with the window edge.
Bottom
The canvas keeps the fit scale (no cropping), but the whole overlay is
shifted so the reference bottom edge lands on the window bottom edge.
Bottom-anchored furniture (a visual-novel dialog box and its controls)
hugs the window bottom at any aspect ratio instead of floating above a
letterbox margin.
Trait Implementations§
impl Copy for SpriteFit
Source§impl<'de> Deserialize<'de> for SpriteFit
impl<'de> Deserialize<'de> for SpriteFit
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SpriteFit, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SpriteFit, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SpriteFit
Source§impl Serialize for SpriteFit
impl Serialize for SpriteFit
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for SpriteFit
Auto Trait Implementations§
impl Freeze for SpriteFit
impl RefUnwindSafe for SpriteFit
impl Send for SpriteFit
impl Sync for SpriteFit
impl Unpin for SpriteFit
impl UnsafeUnpin for SpriteFit
impl UnwindSafe for SpriteFit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.