Struct ggez::graphics::DrawParam [−][src]
Expand description
A struct containing all the necessary info for drawing a Drawable
.
This struct implements the Default
trait, so to set only some parameter
you can just do:
let my_dest = glam::vec2(13.0, 37.0); graphics::draw(ctx, drawable, DrawParam::default().dest(my_dest) );
As a shortcut, it also implements From
for a variety of tuple types.
Fields
src: Rect
A 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: Color
Default: white.
trans: Transform
Where to put the Drawable
.
Implementations
Set the drawable color. This will be blended with whatever color the drawn object already is.
Set the scaling factors of the drawable.
Set the transformation offset of the drawable.
Set the transformation matrix of the drawable.
Trait Implementations
Create a DrawParam
from a location and color
Create a DrawParam
from a location, rotation and color
Create a DrawParam
from a location, rotation, offset and color
Create a DrawParam
from a location, rotation, offset, scale and color
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.
Auto Trait Implementations
impl RefUnwindSafe for DrawParam
impl UnwindSafe for DrawParam
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V