Enum bevy_render::camera::ScalingMode
source · pub enum ScalingMode {
None,
WindowSize,
Auto {
min_width: f32,
min_height: f32,
},
FixedVertical(f32),
FixedHorizontal(f32),
}
Variants
None
Manually specify left/right/top/bottom values. Ignore window resizing; the image will stretch.
WindowSize
Match the window size. 1 world unit = 1 pixel.
Auto
Use minimal possible viewport size while keeping the aspect ratio. Arguments are in world units.
FixedVertical(f32)
Keep vertical axis constant; resize horizontal with aspect ratio. The argument is the desired height of the viewport in world units.
FixedHorizontal(f32)
Keep horizontal axis constant; resize vertical with aspect ratio. The argument is the desired width of the viewport in world units.
Trait Implementations
sourceimpl Clone for ScalingMode
impl Clone for ScalingMode
sourcefn clone(&self) -> ScalingMode
fn clone(&self) -> ScalingMode
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for ScalingMode
impl Debug for ScalingMode
sourceimpl<'de> Deserialize<'de> for ScalingMode
impl<'de> Deserialize<'de> for ScalingMode
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Enum for ScalingMode
impl Enum for ScalingMode
sourcefn field(&self, __name_param: &str) -> Option<&dyn Reflect>
fn field(&self, __name_param: &str) -> Option<&dyn Reflect>
Returns a reference to the value of the field (in the current variant) with the given name. Read more
sourcefn field_at(&self, __index_param: usize) -> Option<&dyn Reflect>
fn field_at(&self, __index_param: usize) -> Option<&dyn Reflect>
Returns a reference to the value of the field (in the current variant) at the given index.
sourcefn field_mut(&mut self, __name_param: &str) -> Option<&mut dyn Reflect>
fn field_mut(&mut self, __name_param: &str) -> Option<&mut dyn Reflect>
Returns a mutable reference to the value of the field (in the current variant) with the given name. Read more
sourcefn field_at_mut(&mut self, __index_param: usize) -> Option<&mut dyn Reflect>
fn field_at_mut(&mut self, __index_param: usize) -> Option<&mut dyn Reflect>
Returns a mutable reference to the value of the field (in the current variant) at the given index.
sourcefn index_of(&self, __name_param: &str) -> Option<usize>
fn index_of(&self, __name_param: &str) -> Option<usize>
Returns the index of the field (in the current variant) with the given name. Read more
sourcefn name_at(&self, __index_param: usize) -> Option<&str>
fn name_at(&self, __index_param: usize) -> Option<&str>
Returns the name of the field (in the current variant) with the given index. Read more
sourcefn iter_fields(&self) -> VariantFieldIter<'_>
fn iter_fields(&self) -> VariantFieldIter<'_>
Returns an iterator over the values of the current variant’s fields.
sourcefn variant_name(&self) -> &str
fn variant_name(&self) -> &str
The name of the current variant.
sourcefn variant_index(&self) -> usize
fn variant_index(&self) -> usize
The index of the current variant.
sourcefn variant_type(&self) -> VariantType
fn variant_type(&self) -> VariantType
The type of the current variant.
fn clone_dynamic(&self) -> DynamicEnum
sourcefn is_variant(&self, variant_type: VariantType) -> bool
fn is_variant(&self, variant_type: VariantType) -> bool
Returns true if the current variant’s type matches the given one.
sourcefn variant_path(&self) -> String
fn variant_path(&self) -> String
Returns the full path to the current variant.
sourceimpl FromReflect for ScalingMode
impl FromReflect for ScalingMode
sourcefn from_reflect(__param0: &dyn Reflect) -> Option<Self>
fn from_reflect(__param0: &dyn Reflect) -> Option<Self>
Constructs a concrete instance of
Self
from a reflected value.sourceimpl Reflect for ScalingMode
impl Reflect for ScalingMode
sourcefn get_type_info(&self) -> &'static TypeInfo
fn get_type_info(&self) -> &'static TypeInfo
sourcefn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Returns the value as a
&mut dyn Any
.sourcefn into_reflect(self: Box<Self>) -> Box<dyn Reflect>
fn into_reflect(self: Box<Self>) -> Box<dyn Reflect>
Casts this type to a boxed reflected value.
sourcefn as_reflect(&self) -> &dyn Reflect
fn as_reflect(&self) -> &dyn Reflect
Casts this type to a reflected value.
sourcefn as_reflect_mut(&mut self) -> &mut dyn Reflect
fn as_reflect_mut(&mut self) -> &mut dyn Reflect
Casts this type to a mutable reflected value.
sourcefn clone_value(&self) -> Box<dyn Reflect>
fn clone_value(&self) -> Box<dyn Reflect>
Clones the value as a
Reflect
trait object. Read moresourcefn set(
&mut self,
__value_param: Box<dyn Reflect>
) -> Result<(), Box<dyn Reflect>>
fn set(
&mut self,
__value_param: Box<dyn Reflect>
) -> Result<(), Box<dyn Reflect>>
Performs a type-checked assignment of a reflected value to this value. Read more
sourcefn apply(&mut self, __value_param: &dyn Reflect)
fn apply(&mut self, __value_param: &dyn Reflect)
Applies a reflected value to this value. Read more
sourcefn reflect_ref(&self) -> ReflectRef<'_>
fn reflect_ref(&self) -> ReflectRef<'_>
Returns an enumeration of “kinds” of type. Read more
sourcefn reflect_mut(&mut self) -> ReflectMut<'_>
fn reflect_mut(&mut self) -> ReflectMut<'_>
Returns a mutable enumeration of “kinds” of type. Read more
sourcefn reflect_owned(self: Box<Self>) -> ReflectOwned
fn reflect_owned(self: Box<Self>) -> ReflectOwned
Returns an owned enumeration of “kinds” of type. Read more
sourcefn reflect_hash(&self) -> Option<u64>
fn reflect_hash(&self) -> Option<u64>
Returns a hash of the value (which includes the type). Read more
sourcefn reflect_partial_eq(&self, value: &dyn Reflect) -> Option<bool>
fn reflect_partial_eq(&self, value: &dyn Reflect) -> Option<bool>
Returns a “partial equality” comparison result. Read more
sourcefn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Debug formatter for the value. Read more
sourcefn serializable(&self) -> Option<Serializable<'_>>
fn serializable(&self) -> Option<Serializable<'_>>
Returns a serializable version of the value. Read more
sourceimpl Serialize for ScalingMode
impl Serialize for ScalingMode
Auto Trait Implementations
impl RefUnwindSafe for ScalingMode
impl Send for ScalingMode
impl Sync for ScalingMode
impl Unpin for ScalingMode
impl UnwindSafe for ScalingMode
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read moresourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read moresourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read moresourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read moresourceimpl<T> DowncastSync for Twhere
T: Any + Send + Sync,
impl<T> DowncastSync for Twhere
T: Any + Send + Sync,
sourceimpl<T> GetPath for Twhere
T: Reflect,
impl<T> GetPath for Twhere
T: Reflect,
sourcefn path<'r, 'p>(
&'r self,
path: &'p str
) -> Result<&'r (dyn Reflect + 'static), ReflectPathError<'p>>
fn path<'r, 'p>(
&'r self,
path: &'p str
) -> Result<&'r (dyn Reflect + 'static), ReflectPathError<'p>>
Returns a reference to the value specified by
path
. Read moresourcefn path_mut<'r, 'p>(
&'r mut self,
path: &'p str
) -> Result<&'r mut (dyn Reflect + 'static), ReflectPathError<'p>>
fn path_mut<'r, 'p>(
&'r mut self,
path: &'p str
) -> Result<&'r mut (dyn Reflect + 'static), ReflectPathError<'p>>
Returns a mutable reference to the value specified by
path
. Read moresourcefn get_path<T, 'r, 'p>(
&'r self,
path: &'p str
) -> Result<&'r T, ReflectPathError<'p>>where
T: Reflect,
fn get_path<T, 'r, 'p>(
&'r self,
path: &'p str
) -> Result<&'r T, ReflectPathError<'p>>where
T: Reflect,
Returns a statically typed reference to the value specified by
path
.sourcefn get_path_mut<T, 'r, 'p>(
&'r mut self,
path: &'p str
) -> Result<&'r mut T, ReflectPathError<'p>>where
T: Reflect,
fn get_path_mut<T, 'r, 'p>(
&'r mut self,
path: &'p str
) -> Result<&'r mut T, ReflectPathError<'p>>where
T: Reflect,
Returns a statically typed mutable reference to the value specified by
path
. Read more