Struct representing the parameters that can be used when drawing.
You can either use this as a builder by calling DrawParams::new
and then chaining methods, or
construct it manually - whichever you find more pleasant to write.
The position that the graphic should be drawn at. Defaults to [0.0, 0.0].
The scale that the graphic should be drawn at. Defaults to [1.0, 1.0].
This can be set to a negative value to flip the graphic around the origin.
The origin of the graphic. Defaults to [0.0, 0.0] (the top left).
Positioning and scaling will be calculated relative to this point.
The rotation of the graphic, in radians. Defaults to 0.0.
A color to multiply the graphic by. Defaults to white.
A sub-region of the graphic to draw. Defaults to None
, which means the the full graphic will be drawn.
This is useful if you're using spritesheets (which you should be!).
Creates a new set of DrawParams
.
Sets the position that the graphic should be drawn at.
Sets the scale that the graphic should be drawn at.
Sets the origin of the graphic.
Sets the rotation of the graphic, in radians.
Sets the color to multiply the graphic by.
Sets the region of the graphic to draw.
Returns the "default value" for a type. Read more
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
impl<SS, SP> SupersetOf for SP where SS: SubsetOf<SP>, | |
The inverse inclusion map: attempts to construct self
from the equivalent element of its superset. Read more
Checks if self
is actually part of its subset T
(and can be converted to it).
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
The inclusion map: converts self
to the equivalent element of its superset.
impl<T> SetParameter for T | |
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where T: Parameter<Self>, | |
Sets value
as a parameter of self
.