#[repr(C)]pub struct Sprite {
pub color: Color,
pub flip_x: bool,
pub flip_y: bool,
pub custom_size: Option<Vec2>,
}
Fields§
§color: Color
The sprite’s color tint
flip_x: bool
Flip the sprite along the X axis
flip_y: bool
Flip the sprite along the Y axis
custom_size: Option<Vec2>
An optional custom size for the sprite that will be used when rendering, instead of the size of the sprite’s image
Trait Implementations§
Source§impl GetTypeRegistration for Sprite
impl GetTypeRegistration for Sprite
Source§impl Reflect for Sprite
impl Reflect for Sprite
fn type_name(&self) -> &str
fn any(&self) -> &(dyn Any + 'static)
fn any_mut(&mut self) -> &mut (dyn Any + 'static)
fn clone_value(&self) -> Box<dyn Reflect>
fn set(&mut self, value: Box<dyn Reflect>) -> Result<(), Box<dyn Reflect>>
fn apply(&mut self, value: &(dyn Reflect + 'static))
fn reflect_ref(&self) -> ReflectRef<'_>
fn reflect_mut(&mut self) -> ReflectMut<'_>
Source§fn serializable(&self) -> Option<Serializable<'_>>
fn serializable(&self) -> Option<Serializable<'_>>
Returns a serializable value, if serialization is supported. Otherwise
None
will be
returned.Source§fn reflect_hash(&self) -> Option<u64>
fn reflect_hash(&self) -> Option<u64>
Returns a hash of the value (which includes the type) if hashing is supported. Otherwise
None
will be returned.Source§impl Struct for Sprite
impl Struct for Sprite
fn field(&self, name: &str) -> Option<&(dyn Reflect + 'static)>
fn field_mut(&mut self, name: &str) -> Option<&mut (dyn Reflect + 'static)>
fn field_at(&self, index: usize) -> Option<&(dyn Reflect + 'static)>
fn field_at_mut(&mut self, index: usize) -> Option<&mut (dyn Reflect + 'static)>
fn name_at(&self, index: usize) -> Option<&str>
fn field_len(&self) -> usize
fn iter_fields(&self) -> FieldIter<'_>
fn clone_dynamic(&self) -> DynamicStruct
Auto Trait Implementations§
impl Freeze for Sprite
impl RefUnwindSafe for Sprite
impl Send for Sprite
impl Sync for Sprite
impl Unpin for Sprite
impl UnwindSafe for Sprite
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,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn 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.Source§fn 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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates
Self
using data from the given World