pub struct SpriteInstance {
pub center: Vec2,
pub rotation: f32,
pub size: Vec2,
pub anchor: Vec2,
pub flip_x: bool,
pub flip_y: bool,
pub uv_min: Vec2,
pub uv_max: Vec2,
pub color: [f32; 4],
pub page: u32,
pub z: f32,
pub blend: SpriteBlend,
}Expand description
One batched sprite. uv is in atlas texels normalized to 0..1.
Fields§
§center: Vec2World-space center, rotation radians, size in world units.
rotation: f32§size: Vec2§anchor: Vec2Normalized anchor: [0.5, 0.5] centers the quad on center,
[0, 0] pins the top-left corner. Y-down.
flip_x: boolMirror about the anchor axes. Canvas fills are flip-invariant; the GPU batch mirrors geometry (UVs untouched).
flip_y: bool§uv_min: Vec2§uv_max: Vec2§color: [f32; 4]RGBA tint, (c * 255) as u8 per channel.
page: u32Atlas page index for multi-texture batches.
z: f32Draw key within one blend range; higher draws on top. Default 0.
Stable-sorted by z inside the range, but blend ranges draw
alpha-then-multiply-then-additive regardless of z (see
SpriteBlend).
blend: SpriteBlendTrait Implementations§
Source§impl Clone for SpriteInstance
impl Clone for SpriteInstance
impl Copy for SpriteInstance
Source§impl Debug for SpriteInstance
impl Debug for SpriteInstance
Auto Trait Implementations§
impl Freeze for SpriteInstance
impl RefUnwindSafe for SpriteInstance
impl Send for SpriteInstance
impl Sync for SpriteInstance
impl Unpin for SpriteInstance
impl UnsafeUnpin for SpriteInstance
impl UnwindSafe for SpriteInstance
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.