pub struct DrawParam {
pub src: Rect,
pub color: Color,
pub trans: Transform,
}Fields§
§src: RectA portion of the drawable to clip, as a fraction of the whole image.
Defaults to the whole image (0,0 to 1,1) if omitted.
color: ColorA color to draw the target with. Default: white.
trans: TransformWhere to put the Drawable.
Implementations§
Source§impl DrawParam
impl DrawParam
Sourcepub fn color(self, color: Color) -> Self
pub fn color(self, color: Color) -> Self
Set the drawable color. This will be blended with whatever color the drawn object already is.
Trait Implementations§
Source§impl<P> From<(P,)> for DrawParam
Create a DrawParam from a location.
Note that this takes a single-element tuple.
It’s a little weird but keeps the trait implementations
from clashing.
impl<P> From<(P,)> for DrawParam
Create a DrawParam from a location.
Note that this takes a single-element tuple.
It’s a little weird but keeps the trait implementations
from clashing.
Source§impl<P> From<(P, f32, Color)> for DrawParam
Create a DrawParam from a location, rotation and color
impl<P> From<(P, f32, Color)> for DrawParam
Create a DrawParam from a location, rotation and color
Source§impl<P> From<(P, f32, P, Color)> for DrawParam
Create a DrawParam from a location, rotation, offset and color
impl<P> From<(P, f32, P, Color)> for DrawParam
Create a DrawParam from a location, rotation, offset and color
Source§impl<P, V> From<(P, f32, P, V, Color)> for DrawParam
Create a DrawParam from a location, rotation, offset, scale and color
impl<P, V> From<(P, f32, P, V, Color)> for DrawParam
Create a DrawParam from a location, rotation, offset, scale and color
impl Copy for DrawParam
impl StructuralPartialEq for DrawParam
Auto Trait Implementations§
impl Freeze for DrawParam
impl RefUnwindSafe for DrawParam
impl Send for DrawParam
impl Sync for DrawParam
impl Unpin for DrawParam
impl UnwindSafe for DrawParam
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,
Source§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