pub struct Sprite {
pub texture_id: u32,
pub source: Option<Rect>,
pub color: [f32; 4],
pub flip_x: bool,
pub flip_y: bool,
}Expand description
Sprite component for rendering
Fields§
§texture_id: u32Texture identifier
source: Option<Rect>Source rectangle in texture (for sprite sheets)
color: [f32; 4]Tint color (RGBA)
flip_x: boolFlip horizontally
flip_y: boolFlip vertically
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Sprite
impl<'de> Deserialize<'de> for Sprite
Source§fn 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
impl StructuralPartialEq for Sprite
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