pub struct SpriteRenderInstance {
pub texture_index: u32,
pub x: f32,
pub y: f32,
pub sx: f32,
pub sy: f32,
pub rot: f32,
pub rgba: [f32; 4],
pub blend: SpriteBlendMode,
pub burn: bool,
}Expand description
Per-frame snapshot of one active sprite, fed to the renderer.
The renderer turns this into a quad draw via sprite_pipeline.
Fields§
§texture_index: u32Index into the engine’s sprite texture pool. The renderer
owns the actual wgpu::Texture for each slot.
x: f32Centre in normalised screen coords [0, 1], top-left origin.
y: f32§sx: f32Per-axis scale relative to the sprite’s native pixel size.
1.0 = native, 2.0 = twice as wide / tall, etc.
sy: f32§rot: f32Rotation in radians, clockwise.
rgba: [f32; 4]Tint colour (premultiplied by a at draw time).
blend: SpriteBlendModeBlend pipeline to pick. See SpriteBlendMode.
burn: booltrue on the one frame a burn=1 sprite is finishing: the
renderer is expected to draw it into render_texture so it
feeds back through the warp loop. The manager drops the
sprite immediately after.
Trait Implementations§
Source§impl Clone for SpriteRenderInstance
impl Clone for SpriteRenderInstance
Source§fn clone(&self) -> SpriteRenderInstance
fn clone(&self) -> SpriteRenderInstance
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SpriteRenderInstance
impl Debug for SpriteRenderInstance
impl Copy for SpriteRenderInstance
Auto Trait Implementations§
impl Freeze for SpriteRenderInstance
impl RefUnwindSafe for SpriteRenderInstance
impl Send for SpriteRenderInstance
impl Sync for SpriteRenderInstance
impl Unpin for SpriteRenderInstance
impl UnwindSafe for SpriteRenderInstance
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,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more