[][src]Struct valora::canvas::Canvas

pub struct Canvas { /* fields omitted */ }

A painting surface.

Methods

impl Canvas[src]

pub fn paint(&mut self, element: impl Paint)[src]

Paints an element.

pub fn set_color(&mut self, color: impl IntoColor)[src]

Sets the current color.

pub fn set_color_alpha(&mut self, color: impl IntoColor, alpha: f32)[src]

Sets the current color.

pub fn move_to(&mut self, dest: P2)[src]

Stats a new path at the given point.

pub fn line_to(&mut self, dest: P2)[src]

Adds a line to the current path which ends at the given point.

pub fn quadratic_to(&mut self, ctrl: P2, end: P2)[src]

Adds a quadratic bezier curve to the current path with the given control and end points.

pub fn cubic_to(&mut self, ctrl0: P2, ctrl1: P2, end: P2)[src]

Adds a cubic bezier curve to the current path with the given control and end points.

pub fn arc(&mut self, center: P2, radii: V2, sweep: Angle, phase: Angle)[src]

Adds an arc segment to the path.

pub fn close_path(&mut self)[src]

Closes the current path.

pub fn set_stroke_width(&mut self, stroke_width: f32)[src]

Sets the width of lines drawn with the stroke().

pub fn fill(&mut self)[src]

Paints the current path by filling the region inside the path.

pub fn stroke(&mut self)[src]

Paints the current path by stroking the path.

pub fn set_shader(&mut self, shader: Shader)[src]

Sets the current shader used to shade rastered paths.

Changing shaders requires making a new draw call to the GPU and tearing down some state. Changing shaders 0-10 times per frame is likely to be fast enough. Changing shaders 500 times per frame will be slow.

Trait Implementations

impl IntoIterator for Canvas[src]

type Item = Element

The type of the elements being iterated over.

type IntoIter = IntoIter<Self::Item>

Which kind of iterator are we turning this into?

Auto Trait Implementations

impl !RefUnwindSafe for Canvas

impl !Send for Canvas

impl !Sync for Canvas

impl Unpin for Canvas

impl !UnwindSafe for Canvas

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> ConvertInto<U> for T where
    U: ConvertFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SetParameter for T

impl<T> SetParameter for T

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,