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

pub struct Drawing<'a, T> { /* fields omitted */ }
Expand description

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

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.

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.

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.

Specify the color via red, green and blue channels.

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

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

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

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.

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.

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.

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.

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

Set the absolute width for the node.

Set the absolute height for the node.

Set the absolute depth for the node.

Short-hand for the width method.

Short-hand for the height method.

Short-hand for the depth method.

Set the x and y dimensions for the node.

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

Set the width and height for the node.

Set the width and height for the node.

Build with the given Absolute Position along the x axis.

Build with the given Absolute Position along the y axis.

Build with the given Absolute Position along the z axis.

Set the Position with some two-dimensional point.

Set the Position with some three-dimensional point.

Set the Position with x y coordinates.

Set the Position with x y z coordinates.

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

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

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

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

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

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

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

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

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

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

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).

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).

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).

Specify the orientation with the given Euler.

The euler must be specified in radians.

Specify the orientation with the given Quaternion.

Specify the “pitch” of the orientation in radians.

This has the same effect as calling x_radians.

Specify the “yaw” of the orientation in radians.

This has the same effect as calling y_radians.

Specify the “roll” of the orientation in radians.

This has the same effect as calling z_radians.

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.

Specify the whole set of fill tessellation options.

Maximum allowed distance to the path when building an approximation.

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

Currently, only the EvenOdd rule is implemented.

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

Default value: Vertical.

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.

The start line cap as specified by the SVG spec.

The end line cap as specified by the SVG spec.

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

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

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.

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.

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

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.

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.

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

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.

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.

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

Default value is MiterClip.

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

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.

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

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.

The total stroke_weight (aka width) of the line.

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

Must be greater than or equal to 1.0.

Maximum allowed distance to the path when building an approximation.

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

Short-hand for the stroke_weight method.

Short-hand for the stroke_tolerance method.

Specify the start point of the arrow.

Specify the end point of the arrow.

Specify the start and end points of the arrow.

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.

The width of the arrow head.

By default, this is equal to weight * 2.0.

Stroke the outline with the given color.

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

The number of sides used to draw the ellipse.

Short-hand for the stroke_weight method.

Short-hand for the stroke_tolerance method.

Specify the start point of the line.

Specify the end point of the line.

Specify the start and end points of the line.

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.

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.

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>.

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.

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.

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>.

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.

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.

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>.

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

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

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

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

Maximum allowed distance to the path when building an approximation.

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

Currently, only the EvenOdd rule is implemented.

Short-hand for the stroke_weight method.

Short-hand for the stroke_tolerance method.

Submit the path events to be tessellated.

Submit the path events as a polyline of points.

Submit the path events as a polyline of points.

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

Submit path events as a polyline of colored points.

Submit path events as a polyline of colored points.

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

Submit path events as a polyline of textured points.

Submit path events as a polyline of textured points.

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

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

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.

Specify the whole set of polygon options.

Stroke the outline with the given color.

Describe the polygon with a sequence of path events.

Describe the polygon with a sequence of points.

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

Describe the polygon with an iterator yielding textured poings.

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

Stroke the outline with the given color.

The font size to use for the text.

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

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

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

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

Build the Text with the given Style.

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

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

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

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

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

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

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

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

This is the default behaviour.

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

Set all the parameters via an existing Layout

Set a color for each glyph, which is typically one character. Colors unspecified glyphs using the drawing color. NOTE: Sometimes, a glyph can represent multiple characters, or be a part in other glyphs.

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.

Stroke the outline with the given color.

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

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Convert the source color to the destination color using the specified method Read more

Convert the source color to the destination color using the bradford method by default Read more

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert into T with values clamped to the color defined bounds Read more

Convert into T. The resulting color might be invalid in its color space Read more

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.