pub struct DrawSprite<'a> { /* private fields */ }Expand description
A sprite to be drawn.
This is a builder struct that allows you to specify extra parameters for the
sprite via method chaining. The sprite is commited to the Graphics
struct when DrawSprite is dropped.
This struct is created using the draw_sprite method on Graphics.
Implementations§
Source§impl<'a> DrawSprite<'a>
impl<'a> DrawSprite<'a>
Sourcepub fn source_pos(self, x: f32, y: f32) -> Self
pub fn source_pos(self, x: f32, y: f32) -> Self
Sets the source position of the sprite.
Sourcepub fn source_size(self, w: f32, h: f32) -> Self
pub fn source_size(self, w: f32, h: f32) -> Self
Sets the source size of the sprite.
Sourcepub fn source_rect(self, x: f32, y: f32, w: f32, h: f32) -> Self
pub fn source_rect(self, x: f32, y: f32, w: f32, h: f32) -> Self
Sets the source rectangle of the sprite.
Equivalent to calling source_pos and then source_size.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for DrawSprite<'a>
impl<'a> !RefUnwindSafe for DrawSprite<'a>
impl<'a> !Send for DrawSprite<'a>
impl<'a> !Sync for DrawSprite<'a>
impl<'a> Unpin for DrawSprite<'a>
impl<'a> !UnwindSafe for DrawSprite<'a>
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