pub struct DrawTextureProParams {
pub source_rect: Option<IRect>,
pub align: SpriteAlign,
pub pivot: Option<Vec2>,
pub size: Vec2,
pub rotation: f32,
pub flip_x: bool,
pub flip_y: bool,
pub blend_mode: BlendMode,
pub rotation_x: f32,
pub y_sort_offset: f32,
}
Fields§
§source_rect: Option<IRect>
The source rectangle in the texture to draw, uses pixel coordinates. If
None
, the entire texture is drawn.
align: SpriteAlign
The alignment of the sprite. The sprite’s origin (its position) will be
aligned according to this value. E.g. if align
is BottomRight
, at
the draw position the bottom right corner of the sprite will be drawn.
pivot: Option<Vec2>
Defined as an offset from the sprite position. The point around which the sprite rotates. None means the pivot is the sprite’s position.
size: Vec2
The desired size of the sprite in world units.
rotation: f32
The rotation to apply to the sprite, in radians.
flip_x: bool
Whether to flip the sprite horizontally.
flip_y: bool
Whether to flip the sprite vertically.
blend_mode: BlendMode
The blend mode to use when drawing the sprite.
rotation_x: f32
Rotation around the x axis for creating a 3d effect.
y_sort_offset: f32
Offset for y-sorting in world-space. This is useful for when sprites have different sizes and pivots, for example when a tree should be “behind” something based on its bottom-most pixel, and not based on its size.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DrawTextureProParams
impl RefUnwindSafe for DrawTextureProParams
impl Send for DrawTextureProParams
impl Sync for DrawTextureProParams
impl Unpin for DrawTextureProParams
impl UnwindSafe for DrawTextureProParams
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
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.