Enum flo_canvas::Draw [−][src]
Instructions for drawing to a canvas
Variants
Begins a new path
Move to a new point
Line to point
Bezier curve to point
Closes the current path
Fill the current path
Draw a line around the current path
LineWidth(f32)
Set the line width
LineWidthPixels(f32)
Set the line width in pixels
LineJoin(LineJoin)
Line join
LineCap(LineCap)
The cap to use on lines
Resets the dash pattern to empty (which is a solid line)
DashLength(f32)
Adds a dash to the current dash pattern
DashOffset(f32)
Sets the offset for the dash pattern
FillColor(Color)
Set the fill color
StrokeColor(Color)
Set the line color
WindingRule(WindingRule)
Set the winding rule for fill operations
BlendMode(BlendMode)
Set how future renderings are blended with one another
Reset the transformation to the identity transformation
CanvasHeight(f32)
Sets a transformation such that: (0,0) is the center point of the canvas (0,height/2) is the top of the canvas Pixels are square
Moves a particular region to the center of the canvas (coordinates are minx, miny, maxx, maxy)
MultiplyTransform(Transform2D)
Multiply a 2D transform into the canvas
Unset the clipping path
Clip to the currently set path
Stores the content of the clipping path from the current layer in a background buffer
Restores what was stored in the background buffer. This should be done on the same layer that the Store operation was called upon.
The buffer is left intact by this operation so it can be restored again in the future.
(If the clipping path has changed since then, the restored image is clipped against the new path)
Releases the buffer created by the last 'Store' operation
Restore will no longer be valid for the current layer
Push the current state of the canvas (line settings, stored image, current path - all state)
Restore a state previously pushed
ClearCanvas(Color)
Clears the canvas entirely to a background colour
Layer(u32)
Selects a particular layer for drawing Layer 0 is selected initially. Layers are drawn in order starting from 0. Layer IDs don't have to be sequential.
Sets how a particular layer is blended with the underlying layer
Clears the current layer
Sprite(SpriteId)
Selects a particular sprite for drawing
Future drawing actions are sent to this sprite: use something like Layer(0)
to start drawing
to a layer again.
Sprites can be repeatedly re-rendered with a single command and their appearance may be cached for efficiency. Actions that affect the whole canvas or layers are not permitted in sprites.
Releases the resources used by the current sprite
SpriteTransform(SpriteTransform)
Adds a sprite transform to the current list of transformations to apply
DrawSprite(SpriteId)
Renders a sprite with a set of transformations
Trait Implementations
impl CanvasEncoding<String> for Draw
[src]
fn encode_canvas(&self, append_to: &mut String)
[src]
impl Clone for Draw
[src]
impl Copy for Draw
[src]
impl Debug for Draw
[src]
impl<'de> Deserialize<'de> for Draw
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<'a, Curve: BezierCurve> From<&'a Curve> for Draw where
Curve::Point: Coordinate2D,
[src]
Curve::Point: Coordinate2D,
impl PartialEq<Draw> for Draw
[src]
impl Serialize for Draw
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for Draw
[src]
Auto Trait Implementations
impl RefUnwindSafe for Draw
[src]
impl Send for Draw
[src]
impl Sync for Draw
[src]
impl Unpin for Draw
[src]
impl UnwindSafe for Draw
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,