Struct nannou::draw::Drawing[][src]

pub struct Drawing<'a, T, S = Default> where
    S: 'a + BaseFloat
{ /* fields omitted */ }

A Drawing in progress.

Drawing provides a way of chaining together method calls describing properties of the thing that we are drawing. Drawing ends when the instance is Dropped, at which point the properties of the drawing are inserted into the Draw type.

When a Drawing begins, a node is immediately created for the drawing within the Draw’s inner geom::Graph. This ensures the correct instantiation order is maintained within the graph. As a result, each Drawing is associated with a single, unique node. Thus a Drawing can be thought of as a way of specifying properties for a node.

Implementations

impl<'a, T, S> Drawing<'a, T, S> where
    S: BaseFloat
[src]

pub fn finish(self)[src]

Complete the drawing and insert it into the parent Draw instance.

This will be called when the Drawing is Dropped if it has not yet been called.

pub fn map_ty<F, T2>(self, map: F) -> Drawing<'a, T2, S> where
    F: FnOnce(T) -> T2,
    T2: Into<Primitive<S>>,
    Primitive<S>: Into<Option<T>>, 
[src]

Apply the given function to the type stored within Draw.

The function is only applied if the node has not yet been Drawn.

Panics if the primitive does not contain type T.

impl<'a, T, S> Drawing<'a, T, S> where
    T: SetColor<ColorScalar> + Into<Primitive<S>>,
    Primitive<S>: Into<Option<T>>,
    S: BaseFloat
[src]

pub fn color<C>(self, color: C) -> Self where
    C: IntoLinSrgba<ColorScalar>, 
[src]

Specify a color.

This method supports any color type that can be converted into RGBA.

Colors that have no alpha channel will be given an opaque alpha channel value 1.0.

pub fn rgb(self, r: ColorScalar, g: ColorScalar, b: ColorScalar) -> Self[src]

Specify the color via red, green and blue channels.

pub fn rgb8(self, r: u8, g: u8, b: u8) -> Self[src]

Specify the color via red, green and blue channels as bytes

pub fn rgba(
    self,
    r: ColorScalar,
    g: ColorScalar,
    b: ColorScalar,
    a: ColorScalar
) -> Self
[src]

Specify the color via red, green, blue and alpha channels.

pub fn rgba8(self, r: u8, g: u8, b: u8, a: u8) -> Self[src]

Specify the color via red, green, blue and alpha channels as bytes.

pub fn hsl(self, h: ColorScalar, s: ColorScalar, l: ColorScalar) -> Self[src]

Specify the color via hue, saturation and luminance.

If you’re looking for HSVA or HSBA, use the hsva method instead.

The given hue expects a value between 0.0 and 1.0 where 0.0 is 0 degress and 1.0 is 360 degrees (or 2 PI radians).

See the wikipedia entry for more details on this color space.

pub fn hsla(
    self,
    h: ColorScalar,
    s: ColorScalar,
    l: ColorScalar,
    a: ColorScalar
) -> Self
[src]

Specify the color via hue, saturation, luminance and an alpha channel.

If you’re looking for HSVA or HSBA, use the hsva method instead.

The given hue expects a value between 0.0 and 1.0 where 0.0 is 0 degress and 1.0 is 360 degrees (or 2 PI radians).

See the wikipedia entry for more details on this color space.

pub fn hsv(self, h: ColorScalar, s: ColorScalar, v: ColorScalar) -> Self[src]

Specify the color via hue, saturation and value (brightness).

This is sometimes also known as “hsb”.

The given hue expects a value between 0.0 and 1.0 where 0.0 is 0 degress and 1.0 is 360 degrees (or 2 PI radians).

See the wikipedia entry for more details on this color space.

pub fn hsva(
    self,
    h: ColorScalar,
    s: ColorScalar,
    v: ColorScalar,
    a: ColorScalar
) -> Self
[src]

Specify the color via hue, saturation, value (brightness) and an alpha channel.

This is sometimes also known as “hsba”.

The given hue expects a value between 0.0 and 1.0 where 0.0 is 0 degress and 1.0 is 360 degrees (or 2 PI radians).

See the wikipedia entry for more details on this color space.

pub fn gray(self, g: ColorScalar) -> Self[src]

Specify the color as gray scale

The given g expects a value between 0.0 and 1.0 where 0.0 is black and 1.0 is white

impl<'a, T, S> Drawing<'a, T, S> where
    T: SetDimensions<S> + Into<Primitive<S>>,
    Primitive<S>: Into<Option<T>>,
    S: BaseFloat
[src]

pub fn width(self, w: S) -> Self[src]

Set the absolute width for the node.

pub fn height(self, h: S) -> Self[src]

Set the absolute height for the node.

pub fn depth(self, d: S) -> Self[src]

Set the absolute depth for the node.

pub fn w(self, w: S) -> Self[src]

Short-hand for the width method.

pub fn h(self, h: S) -> Self[src]

Short-hand for the height method.

pub fn d(self, d: S) -> Self[src]

Short-hand for the depth method.

pub fn wh(self, v: Vector2<S>) -> Self[src]

Set the x and y dimensions for the node.

pub fn whd(self, v: Vector3<S>) -> Self[src]

Set the x, y and z dimensions for the node.

pub fn w_h(self, x: S, y: S) -> Self[src]

Set the width and height for the node.

pub fn w_h_d(self, x: S, y: S, z: S) -> Self[src]

Set the width and height for the node.

impl<'a, T, S> Drawing<'a, T, S> where
    T: SetPosition<S> + Into<Primitive<S>>,
    Primitive<S>: Into<Option<T>>,
    S: BaseFloat
[src]

pub fn x(self, x: S) -> Self[src]

Build with the given Absolute Position along the x axis.

pub fn y(self, y: S) -> Self[src]

Build with the given Absolute Position along the y axis.

pub fn z(self, z: S) -> Self[src]

Build with the given Absolute Position along the z axis.

pub fn xy(self, p: Point2<S>) -> Self[src]

Set the Position with some two-dimensional point.

pub fn xyz(self, p: Point3<S>) -> Self[src]

Set the Position with some three-dimensional point.

pub fn x_y(self, x: S, y: S) -> Self[src]

Set the Position with x y coordinates.

pub fn x_y_z(self, x: S, y: S, z: S) -> Self[src]

Set the Position with x y z coordinates.

impl<'a, T, S> Drawing<'a, T, S> where
    T: SetOrientation<S> + Into<Primitive<S>>,
    Primitive<S>: Into<Option<T>>,
    S: BaseFloat
[src]

pub fn look_at(self, target: Point3<S>) -> Self[src]

Describe orientation via the vector that points to the given target.

pub fn x_radians(self, x: S) -> Self[src]

Specify the orientation around the x axis as an absolute value in radians.

pub fn y_radians(self, y: S) -> Self[src]

Specify the orientation around the y axis as an absolute value in radians.

pub fn z_radians(self, z: S) -> Self[src]

Specify the orientation around the z axis as an absolute value in radians.

pub fn x_degrees(self, x: S) -> Self where
    S: BaseFloat
[src]

Specify the orientation around the x axis as an absolute value in degrees.

pub fn y_degrees(self, y: S) -> Self where
    S: BaseFloat
[src]

Specify the orientation around the y axis as an absolute value in degrees.

pub fn z_degrees(self, z: S) -> Self where
    S: BaseFloat
[src]

Specify the orientation around the z axis as an absolute value in degrees.

pub fn x_turns(self, x: S) -> Self where
    S: BaseFloat
[src]

Specify the orientation around the x axis as a number of turns around the axis.

pub fn y_turns(self, y: S) -> Self where
    S: BaseFloat
[src]

Specify the orientation around the y axis as a number of turns around the axis.

pub fn z_turns(self, z: S) -> Self where
    S: BaseFloat
[src]

Specify the orientation around the z axis as a number of turns around the axis.

pub fn radians(self, v: Vector3<S>) -> Self[src]

Specify the orientation along each axis with the given Vector of radians.

This has the same affect as calling self.x_radians(v.x).y_radians(v.y).z_radians(v.z).

pub fn degrees(self, v: Vector3<S>) -> Self where
    S: BaseFloat
[src]

Specify the orientation along each axis with the given Vector of degrees.

This has the same affect as calling self.x_degrees(v.x).y_degrees(v.y).z_degrees(v.z).

pub fn turns(self, v: Vector3<S>) -> Self where
    S: BaseFloat
[src]

Specify the orientation along each axis with the given Vector of “turns”.

This has the same affect as calling self.x_turns(v.x).y_turns(v.y).z_turns(v.z).

pub fn euler<A>(self, e: Euler<A>) -> Self where
    S: BaseFloat,
    A: Angle + Into<Rad<S>>, 
[src]

Specify the orientation with the given Euler.

The euler can be specified in either radians (via Rad) or degrees (via Deg).

pub fn quaternion(self, q: Quaternion<S>) -> Self where
    S: BaseFloat
[src]

Specify the orientation with the given Quaternion.

pub fn pitch(self, pitch: S) -> Self[src]

Specify the “pitch” of the orientation in radians.

This has the same effect as calling x_radians.

pub fn yaw(self, yaw: S) -> Self[src]

Specify the “yaw” of the orientation in radians.

This has the same effect as calling y_radians.

pub fn roll(self, roll: S) -> Self[src]

Specify the “roll” of the orientation in radians.

This has the same effect as calling z_radians.

pub fn rotate(self, radians: S) -> Self[src]

Assuming we’re looking at a 2D plane, positive values cause a clockwise rotation where the given value is specified in radians.

This is equivalent to calling the z_radians or roll methods.

impl<'a, T, S> Drawing<'a, T, S> where
    T: SetFill + Into<Primitive<S>>,
    Primitive<S>: Into<Option<T>>,
    S: BaseFloat
[src]

pub fn fill_opts(self, opts: FillOptions) -> Self[src]

Specify the whole set of fill tessellation options.

pub fn fill_tolerance(self, tolerance: f32) -> Self[src]

Maximum allowed distance to the path when building an approximation.

pub fn fill_rule(self, rule: FillRule) -> Self[src]

Specify the rule used to determine what is inside and what is outside of the shape.

Currently, only the EvenOdd rule is implemented.

pub fn fill_sweep_orientation(self, orientation: Orientation) -> Self[src]

Whether to perform a vertical or horizontal traversal of the geometry.

Default value: Vertical.

pub fn handle_intersections(self, b: bool) -> Self[src]

A fast path to avoid some expensive operations if the path is known to not have any self-intersections.

Do not set this to false if the path may have intersecting edges else the tessellator may panic or produce incorrect results. In doubt, do not change the default value.

Default value: true.

impl<'a, T, S> Drawing<'a, T, S> where
    T: SetStroke + Into<Primitive<S>>,
    Primitive<S>: Into<Option<T>>,
    S: BaseFloat
[src]

pub fn start_cap(self, cap: LineCap) -> Self[src]

The start line cap as specified by the SVG spec.

pub fn end_cap(self, cap: LineCap) -> Self[src]

The end line cap as specified by the SVG spec.

pub fn caps(self, cap: LineCap) -> Self[src]

The start and end line cap as specified by the SVG spec.

pub fn start_cap_butt(self) -> Self[src]

The stroke for each sub-path does not extend beyond its two endpoints. A zero length sub-path will therefore not have any stroke.

pub fn start_cap_square(self) -> Self[src]

At the end of each sub-path, the shape representing the stroke will be extended by a rectangle with the same width as the stroke width and whose length is half of the stroke width. If a sub-path has zero length, then the resulting effect is that the stroke for that sub-path consists solely of a square with side length equal to the stroke width, centered at the sub-path’s point.

pub fn start_cap_round(self) -> Self[src]

At each end of each sub-path, the shape representing the stroke will be extended by a half circle with a radius equal to the stroke width. If a sub-path has zero length, then the resulting effect is that the stroke for that sub-path consists solely of a full circle centered at the sub-path’s point.

pub fn end_cap_butt(self) -> Self[src]

The stroke for each sub-path does not extend beyond its two endpoints. A zero length sub-path will therefore not have any stroke.

pub fn end_cap_square(self) -> Self[src]

At the end of each sub-path, the shape representing the stroke will be extended by a rectangle with the same width as the stroke width and whose length is half of the stroke width. If a sub-path has zero length, then the resulting effect is that the stroke for that sub-path consists solely of a square with side length equal to the stroke width, centered at the sub-path’s point.

pub fn end_cap_round(self) -> Self[src]

At each end of each sub-path, the shape representing the stroke will be extended by a half circle with a radius equal to the stroke width. If a sub-path has zero length, then the resulting effect is that the stroke for that sub-path consists solely of a full circle centered at the sub-path’s point.

pub fn caps_butt(self) -> Self[src]

The stroke for each sub-path does not extend beyond its two endpoints. A zero length sub-path will therefore not have any stroke.

pub fn caps_square(self) -> Self[src]

At the end of each sub-path, the shape representing the stroke will be extended by a rectangle with the same width as the stroke width and whose length is half of the stroke width. If a sub-path has zero length, then the resulting effect is that the stroke for that sub-path consists solely of a square with side length equal to the stroke width, centered at the sub-path’s point.

pub fn caps_round(self) -> Self[src]

At each end of each sub-path, the shape representing the stroke will be extended by a half circle with a radius equal to the stroke width. If a sub-path has zero length, then the resulting effect is that the stroke for that sub-path consists solely of a full circle centered at the sub-path’s point.

pub fn join(self, join: LineJoin) -> Self[src]

The way in which lines are joined at the vertices, matching the SVG spec.

Default value is MiterClip.

pub fn join_miter(self) -> Self[src]

A sharp corner is to be used to join path segments.

pub fn join_miter_clip(self) -> Self[src]

Same as a join_miter, but if the miter limit is exceeded, the miter is clipped at a miter length equal to the miter limit value multiplied by the stroke width.

pub fn join_round(self) -> Self[src]

A round corner is to be used to join path segments.

pub fn join_bevel(self) -> Self[src]

A bevelled corner is to be used to join path segments. The bevel shape is a triangle that fills the area between the two stroked segments.

pub fn stroke_weight(self, stroke_weight: f32) -> Self[src]

The total stroke_weight (aka width) of the line.

pub fn miter_limit(self, limit: f32) -> Self[src]

Describes the limit before miter lines will clip, as described in the SVG spec.

Must be greater than or equal to 1.0.

pub fn stroke_tolerance(self, tolerance: f32) -> Self[src]

Maximum allowed distance to the path when building an approximation.

pub fn stroke_opts(self, opts: StrokeOptions) -> Self[src]

Specify the full set of stroke options for the path tessellation.

impl<'a, S> Drawing<'a, Arrow<S>, S> where
    S: BaseFloat
[src]

pub fn weight(self, weight: f32) -> Self[src]

Short-hand for the stroke_weight method.

pub fn tolerance(self, tolerance: f32) -> Self[src]

Short-hand for the stroke_tolerance method.

pub fn start(self, start: Point2<S>) -> Self[src]

Specify the start point of the arrow.

pub fn end(self, end: Point2<S>) -> Self[src]

Specify the end point of the arrow.

pub fn points(self, start: Point2<S>, end: Point2<S>) -> Self[src]

Specify the start and end points of the arrow.

pub fn head_length(self, length: S) -> Self[src]

The length of the arrow head.

By default, this is equal to weight * 4.0.

This value will be clamped to the length of the line itself.

pub fn head_width(self, width: S) -> Self[src]

The width of the arrow head.

By default, this is equal to weight * 2.0.

impl<'a, S> Drawing<'a, Ellipse<S>, S> where
    S: BaseFloat
[src]

pub fn stroke<C>(self, color: C) -> Self where
    C: IntoLinSrgba<ColorScalar>, 
[src]

Stroke the outline with the given color.

pub fn radius(self, radius: S) -> Self[src]

Specify the width and height of the Ellipse via a given radius.

pub fn resolution(self, resolution: usize) -> Self[src]

The number of sides used to draw the ellipse.

impl<'a, S> Drawing<'a, Line<S>, S> where
    S: BaseFloat
[src]

pub fn weight(self, weight: f32) -> Self[src]

Short-hand for the stroke_weight method.

pub fn tolerance(self, tolerance: f32) -> Self[src]

Short-hand for the stroke_tolerance method.

pub fn start(self, start: Point2<S>) -> Self[src]

Specify the start point of the line.

pub fn end(self, end: Point2<S>) -> Self[src]

Specify the end point of the line.

pub fn points(self, start: Point2<S>, end: Point2<S>) -> Self[src]

Specify the start and end points of the line.

impl<'a, S> Drawing<'a, Vertexless, S> where
    S: BaseFloat
[src]

pub fn points<I>(self, points: I) -> DrawingMesh<'a, S> where
    I: IntoIterator,
    I::Item: Into<Point<S>>, 
[src]

Describe the mesh with a sequence of points.

The given iterator may yield any type that can be converted directly into Point3s.

This method assumes that the entire mesh should be coloured with a single colour. If a colour is not specified via one of the builder methods, a default colour will be retrieved from the inner Theme.

pub fn points_colored<I, P, C>(self, points: I) -> DrawingMesh<'a, S> where
    I: IntoIterator<Item = (P, C)>,
    P: Into<Point<S>>,
    C: IntoLinSrgba<ColorScalar>, 
[src]

Describe the mesh with a sequence of colored points.

Each of the points must be represented as a tuple containing the point and the color in that order, e.g. (point, color). point may be of any type that implements Into<Point3> and color may be of any type that implements IntoLinSrgba.

pub fn points_textured<I, P, T>(
    self,
    view: &dyn ToTextureView,
    points: I
) -> DrawingMesh<'a, S> where
    I: IntoIterator<Item = (P, T)>,
    P: Into<Point<S>>,
    T: Into<TexCoords<S>>, 
[src]

Describe the mesh with a sequence of textured points.

Each of the vertices must be represented as a tuple containing the point and tex coordinates in that order, e.g. (point, tex_coords). point may be of any type that implements Into<Point3> and tex_coords may be of any type that implements Into<Point2>.

pub fn tris<I, V>(self, tris: I) -> DrawingMesh<'a, S> where
    I: IntoIterator<Item = Tri<V>>,
    V: Into<Point<S>>, 
[src]

Describe the mesh with a sequence of triangles.

Each triangle may be composed of any vertex type that may be converted directly into Point3s.

This method assumes that the entire mesh should be coloured with a single colour. If a colour is not specified via one of the builder methods, a default colour will be retrieved from the inner Theme.

pub fn tris_colored<I, P, C>(self, tris: I) -> DrawingMesh<'a, S> where
    I: IntoIterator<Item = Tri<(P, C)>>,
    P: Into<Point<S>>,
    C: IntoLinSrgba<ColorScalar>, 
[src]

Describe the mesh with a sequence of colored triangles.

Each of the vertices must be represented as a tuple containing the point and the color in that order, e.g. (point, color). point may be of any type that implements Into<Point3> and color may be of any type that implements IntoLinSrgba.

pub fn tris_textured<I, P, T>(
    self,
    view: &dyn ToTextureView,
    tris: I
) -> DrawingMesh<'a, S> where
    I: IntoIterator<Item = Tri<(P, T)>>,
    P: Into<Point<S>>,
    T: Into<TexCoords<S>>, 
[src]

Describe the mesh with a sequence of textured triangles.

Each of the vertices must be represented as a tuple containing the point and tex coordinates in that order, e.g. (point, tex_coords). point may be of any type that implements Into<Point3> and tex_coords may be of any type that implements Into<Point2>.

pub fn indexed<V, I>(self, points: V, indices: I) -> DrawingMesh<'a, S> where
    V: IntoIterator,
    V::Item: Into<Point<S>>,
    I: IntoIterator<Item = usize>, 
[src]

Describe the mesh with the given indexed points.

Each trio of indices describes a single triangle made up of points.

Each point may be any type that may be converted directly into the Point3 type.

pub fn indexed_colored<V, I, P, C>(
    self,
    points: V,
    indices: I
) -> DrawingMesh<'a, S> where
    V: IntoIterator<Item = (P, C)>,
    I: IntoIterator<Item = usize>,
    P: Into<Point<S>>,
    C: IntoLinSrgba<ColorScalar>, 
[src]

Describe the mesh with the given indexed, colored points.

Each trio of indices describes a single triangle made up of colored points.

Each of the points must be represented as a tuple containing the point and the color in that order, e.g. (point, color). point may be of any type that implements Into<Point3> and color may be of any type that implements IntoLinSrgba.

pub fn indexed_textured<V, I, P, T>(
    self,
    view: &dyn ToTextureView,
    points: V,
    indices: I
) -> DrawingMesh<'a, S> where
    V: IntoIterator<Item = (P, T)>,
    I: IntoIterator<Item = usize>,
    P: Into<Point<S>>,
    T: Into<TexCoords<S>>, 
[src]

Describe the mesh with the given indexed, textured points.

Each trio of indices describes a single triangle made up of colored points.

Each of the points must be represented as a tuple containing the point and the texture coordinates in that order, e.g. (point, tex_coords). point may be of any type that implements Into<Point3> and tex_coords may be of any type that implements Into<Point2>.

impl<'a, S> Drawing<'a, PathInit<S>, S> where
    S: BaseFloat
[src]

pub fn fill(self) -> DrawingPathFill<'a, S>[src]

Specify that we want to use fill tessellation for the path.

The returned building context allows for specifying the fill tessellation options.

pub fn stroke(self) -> DrawingPathStroke<'a, S>[src]

Specify that we want to use stroke tessellation for the path.

The returned building context allows for specifying the stroke tessellation options.

impl<'a, S> Drawing<'a, PathOptions<FillOptions, S>, S> where
    S: BaseFloat
[src]

pub fn tolerance(self, tolerance: f32) -> Self[src]

Maximum allowed distance to the path when building an approximation.

pub fn rule(self, rule: FillRule) -> Self[src]

Specify the rule used to determine what is inside and what is outside of the shape.

Currently, only the EvenOdd rule is implemented.

impl<'a, S> Drawing<'a, PathOptions<StrokeOptions, S>, S> where
    S: BaseFloat
[src]

pub fn weight(self, weight: f32) -> Self[src]

Short-hand for the stroke_weight method.

pub fn tolerance(self, tolerance: f32) -> Self[src]

Short-hand for the stroke_tolerance method.

impl<'a, T, S> Drawing<'a, PathOptions<T, S>, S> where
    S: BaseFloat,
    T: TessellationOptions,
    PathOptions<T, S>: Into<Primitive<S>>,
    Primitive<S>: Into<Option<PathOptions<T, S>>>, 
[src]

pub fn events<I>(self, events: I) -> DrawingPath<'a, S> where
    I: IntoIterator<Item = PathEvent>, 
[src]

Submit the path events to be tessellated.

pub fn points<I>(self, points: I) -> DrawingPath<'a, S> where
    I: IntoIterator,
    I::Item: Into<Point2<S>>, 
[src]

Submit the path events as a polyline of points.

pub fn points_closed<I>(self, points: I) -> DrawingPath<'a, S> where
    I: IntoIterator,
    I::Item: Into<Point2<S>>, 
[src]

Submit the path events as a polyline of points.

An event will be generated that closes the start and end points.

pub fn points_colored<I, P, C>(self, points: I) -> DrawingPath<'a, S> where
    S: BaseFloat,
    I: IntoIterator<Item = (P, C)>,
    P: Into<Point2<S>>,
    C: IntoLinSrgba<ColorScalar>, 
[src]

Submit path events as a polyline of colored points.

pub fn points_colored_closed<I, P, C>(self, points: I) -> DrawingPath<'a, S> where
    S: BaseFloat,
    I: IntoIterator<Item = (P, C)>,
    P: Into<Point2<S>>,
    C: IntoLinSrgba<ColorScalar>, 
[src]

Submit path events as a polyline of colored points.

The path with automatically close from the end point to the start point.

pub fn points_textured<I, P, TC>(
    self,
    view: &dyn ToTextureView,
    points: I
) -> DrawingPath<'a, S> where
    S: BaseFloat,
    I: IntoIterator<Item = (P, TC)>,
    P: Into<Point2<S>>,
    TC: Into<TexCoords<S>>, 
[src]

Submit path events as a polyline of textured points.

pub fn points_textured_closed<I, P, TC>(
    self,
    view: &dyn ToTextureView,
    points: I
) -> DrawingPath<'a, S> where
    S: BaseFloat,
    I: IntoIterator<Item = (P, TC)>,
    P: Into<Point2<S>>,
    TC: Into<TexCoords<S>>, 
[src]

Submit path events as a polyline of textured points.

The path with automatically close from the end point to the start point.

impl<'a, S, T> Drawing<'a, T, S> where
    S: BaseFloat,
    T: SetPolygon<S> + Into<Primitive<S>>,
    Primitive<S>: Into<Option<T>>, 
[src]

pub fn no_fill(self) -> Self[src]

Specify no fill color and in turn no fill tessellation for the polygon.

pub fn stroke_color<C>(self, color: C) -> Self where
    C: IntoLinSrgba<ColorScalar>, 
[src]

Specify a color to use for stroke tessellation.

Stroke tessellation will only be performed if this method or one of the SetStroke methods are called.

pub fn polygon_options(self, opts: PolygonOptions<S>) -> Self[src]

Specify the whole set of polygon options.

impl<'a, S> Drawing<'a, PolygonInit<S>, S> where
    S: BaseFloat
[src]

pub fn stroke<C>(self, color: C) -> Self where
    C: IntoLinSrgba<ColorScalar>, 
[src]

Stroke the outline with the given color.

pub fn events<I>(self, events: I) -> DrawingPolygon<'a, S> where
    S: BaseFloat,
    I: IntoIterator<Item = PathEvent>, 
[src]

Describe the polygon with a sequence of path events.

pub fn points<I>(self, points: I) -> DrawingPolygon<'a, S> where
    S: BaseFloat,
    I: IntoIterator,
    I::Item: Into<Point2<S>>, 
[src]

Describe the polygon with a sequence of points.

pub fn points_colored<I, P, C>(self, points: I) -> DrawingPolygon<'a, S> where
    S: BaseFloat,
    I: IntoIterator<Item = (P, C)>,
    P: Into<Point2<S>>,
    C: IntoLinSrgba<ColorScalar>, 
[src]

Consumes an iterator of points and converts them to an iterator yielding path events.

pub fn points_textured<I, P, T>(
    self,
    view: &dyn ToTextureView,
    points: I
) -> DrawingPolygon<'a, S> where
    S: BaseFloat,
    I: IntoIterator<Item = (P, T)>,
    P: Into<Point2<S>>,
    T: Into<TexCoords<S>>, 
[src]

Describe the polygon with an iterator yielding textured poings.

impl<'a, S> Drawing<'a, Quad<S>, S> where
    S: BaseFloat
[src]

pub fn points<P>(self, a: P, b: P, c: P, d: P) -> Self where
    P: Into<Point2<S>>, 
[src]

Use the given points as the vertices (corners) of the quad.

impl<'a, S> Drawing<'a, Rect<S>, S> where
    S: BaseFloat
[src]

pub fn stroke<C>(self, color: C) -> Self where
    C: IntoLinSrgba<ColorScalar>, 
[src]

Stroke the outline with the given color.

impl<'a, S> Drawing<'a, Text<S>, S> where
    S: BaseFloat
[src]

pub fn font_size(self, size: FontSize) -> Self[src]

The font size to use for the text.

pub fn no_line_wrap(self) -> Self[src]

Specify that the Text should not wrap lines around the width.

pub fn wrap_by_word(self) -> Self[src]

Line wrap the Text at the beginning of the first word that exceeds the width.

pub fn wrap_by_character(self) -> Self[src]

Line wrap the Text at the beginning of the first character that exceeds the width.

pub fn font(self, font: Font) -> Self[src]

A method for specifying the Font used for displaying the Text.

pub fn with_style(self, style: Style) -> Self[src]

Build the Text with the given Style.

pub fn justify(self, justify: Justify) -> Self[src]

Describe the end along the x axis to which the text should be aligned.

pub fn left_justify(self) -> Self[src]

Align the text to the left of its bounding Rect’s x axis range.

pub fn center_justify(self) -> Self[src]

Align the text to the middle of its bounding Rect’s x axis range.

pub fn right_justify(self) -> Self[src]

Align the text to the right of its bounding Rect’s x axis range.

pub fn line_spacing(self, spacing: Scalar) -> Self[src]

Specify how much vertical space should separate each line of text.

pub fn y_align_text(self, align: Align) -> Self[src]

Specify how the whole text should be aligned along the y axis of its bounding rectangle

pub fn align_text_top(self) -> Self[src]

Align the top edge of the text with the top edge of its bounding rectangle.

pub fn align_text_middle_y(self) -> Self[src]

Align the middle of the text with the middle of the bounding rect along the y axis.

This is the default behaviour.

pub fn align_text_bottom(self) -> Self[src]

Align the bottom edge of the text with the bottom edge of its bounding rectangle.

pub fn layout(self, layout: &Layout) -> Self[src]

Set all the parameters via an existing Layout

pub fn glyph_colors<I, C>(self, glyph_colors: I) -> Self where
    I: IntoIterator<Item = C>,
    C: IntoLinSrgba<ColorScalar>, 
[src]

Set a color for each glyph. Colors unspecified glyphs using the drawing color.

impl<'a, S> Drawing<'a, Texture<S>, S> where
    S: BaseFloat
[src]

pub fn area(self, rect: Rect) -> Self[src]

Specify the area of the texture to draw.

The bounds of the rectangle should represent the desired area as texture coordinates of the underlying texture.

Texture coordinates range from (0.0, 0.0) in the bottom left of the texture, to (1.0, 1.0) in the top right of the texture.

By default, the area represents the full extent of the texture.

impl<'a, S> Drawing<'a, Tri<S>, S> where
    S: BaseFloat
[src]

pub fn stroke<C>(self, color: C) -> Self where
    C: IntoLinSrgba<ColorScalar>, 
[src]

Stroke the outline with the given color.

pub fn points<P>(self, a: P, b: P, c: P) -> Self where
    P: Into<Point2<S>>, 
[src]

Use the given points as the vertices (corners) of the triangle.

Trait Implementations

impl<'a, T: Debug, S: Debug> Debug for Drawing<'a, T, S> where
    S: 'a + BaseFloat
[src]

impl<'a, T, S> Drop for Drawing<'a, T, S> where
    S: BaseFloat
[src]

Auto Trait Implementations

impl<'a, T, S = f32> !RefUnwindSafe for Drawing<'a, T, S>

impl<'a, T, S = f32> !Send for Drawing<'a, T, S>

impl<'a, T, S = f32> !Sync for Drawing<'a, T, S>

impl<'a, T, S> Unpin for Drawing<'a, T, S> where
    T: Unpin

impl<'a, T, S = f32> !UnwindSafe for Drawing<'a, T, S>

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    T: Component + Float,
    D: AdaptFrom<S, Swp, Dwp, T>,
    Swp: WhitePoint,
    Dwp: WhitePoint
[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> Downcast<T> for T

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

impl<T> Instrument for T[src]

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

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> SetParameter for T

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<T> Upcast<T> for T

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