pub struct Sprite {
pub shader: Option<ShaderRef>,
pub textures: SmallVec<[SpriteTexture; 4]>,
pub uniforms: HashMap<Cow<'static, str>, GlowUniformValue>,
pub region: Rect<f32, f32>,
pub page: f32,
pub tint: Rgba<f32>,
pub transform: Transform<f32, f32, f32>,
pub size: Option<Vec2<f32>>,
pub pivot: Vec2<f32>,
pub blending: Option<GlowBlending>,
pub screen_space: bool,
}Fields§
§shader: Option<ShaderRef>§textures: SmallVec<[SpriteTexture; 4]>§uniforms: HashMap<Cow<'static, str>, GlowUniformValue>§region: Rect<f32, f32>§page: f32§tint: Rgba<f32>§transform: Transform<f32, f32, f32>§size: Option<Vec2<f32>>§pivot: Vec2<f32>§blending: Option<GlowBlending>§screen_space: boolImplementations§
Source§impl Sprite
impl Sprite
pub fn single(texture: SpriteTexture) -> Self
pub fn shader(self, value: ShaderRef) -> Self
pub fn texture(self, value: SpriteTexture) -> Self
pub fn uniform(self, key: Cow<'static, str>, value: GlowUniformValue) -> Self
pub fn region_page(self, region: Rect<f32, f32>, page: f32) -> Self
pub fn tint(self, value: Rgba<f32>) -> Self
pub fn transform(self, value: Transform<f32, f32, f32>) -> Self
pub fn position(self, value: Vec2<f32>) -> Self
pub fn orientation(self, value: Quaternion<f32>) -> Self
pub fn rotation(self, angle_radians: f32) -> Self
pub fn scale(self, value: Vec2<f32>) -> Self
pub fn size(self, value: Vec2<f32>) -> Self
pub fn pivot(self, value: Vec2<f32>) -> Self
pub fn blending(self, value: GlowBlending) -> Self
pub fn screen_space(self, value: bool) -> Self
Trait Implementations§
Source§impl Drawable for Sprite
impl Drawable for Sprite
fn draw( &self, context: &mut DrawContext, graphics: &mut dyn GraphicsTarget<Vertex>, )
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