pub struct SpriteInstance {}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: SpriteBlend§light_mask: u32Light layer bits, 1 (layer 0) by default. The sprite is lit by every
light whose light_mask shares the sprite’s lowest set bit, and reads
the layer that bit names (see light); 0 renders it
unlit, ignoring ambient and modulate alike.
Trait 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
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.