Struct nannou::draw::Draw [] [src]

pub struct Draw<S = DefaultScalar> where
    S: BaseFloat
{ /* fields omitted */ }

A simple API for drawing 2D and 3D graphics.

Draw provides a simple way to compose together geometric primitives and text (TODO) with custom colours and textures and draw them to the screen.

You can also ask Draw for the sequence of vertices or triangles (with or without colours/textures) that make up the entire scene that you have created.

Internally Draw uses a geom::Graph for placing geometry and text in 3D space.

Draw has 2 groups of methods:

  1. Creation: These methods compose new geometry and text with colours and textures.

  2. Rendering: These methods provide ways of rendering the graphics either directly to the frame for the current display or to a list of vertices or triangles for lower-level, more flexible access.

Methods

impl<S> Draw<S> where
    S: BaseFloat
[src]

[src]

Create a new Draw instance.

This is the same as calling Draw::default.

[src]

Resets all state within the Draw instance.

[src]

Specify a color with which the background should be cleared.

[src]

Add the given type to be drawn.

[src]

Begin drawing an Ellipse.

[src]

Begin drawing a Line.

[src]

Begin drawing a Quad.

[src]

Begin drawing a Rect.

[src]

Begin drawing a Triangle.

[src]

Produce the transformed mesh vertices for the node at the given index.

Returns None if there is no node for the given index.

[src]

Produce the transformed triangles for the node at the given index.

Note: If the node's Drawing was still in progress, it will first be finished and inserted into the mesh and geometry graph before producing the triangles iterator.

Important traits for RawVertices<'a, S>
[src]

Produce an iterator yielding all vertices from the inner mesh transformed via the inner geometry graph.

This method ignores the mesh indices buffer and instead produces the vertices "raw".

Note: If there are any Drawings in progress, these will first be drained and completed before any vertices are yielded.

Important traits for Vertices<'a, S>
[src]

Produce an iterator yielding all indexed vertices from the inner mesh transformed via the inner geometry graph.

Vertices are yielded in depth-first-order of the geometry graph nodes from which they are produced.

Note: If there are any Drawings in progress, these will first be drained and completed before any vertices are yielded.

[src]

Produce an iterator yielding all triangles from the inner mesh transformed via the inner geometry graph.

Triangles are yielded in depth-first-order of the geometry graph nodes from which they are produced.

Note: If there are any Drawings in progress, these will first be drained and completed before any vertices are yielded.

[src]

Borrow the Draw's inner Mesh.

[src]

The length of the untransformed node at the given index along the axis returned by the given point_axis function.

[src]

The length of the untransformed node at the given index along the x axis.

[src]

The length of the untransformed node at the given index along the y axis.

[src]

The length of the untransformed node at the given index along the y axis.

[src]

Determine the raw, untransformed dimensions of the node at the given index.

Returns None if their is no node within the geom::Graph for the given index or if the node has not yet been Drawn.

[src]

The length of the transformed node at the given index along the axis returned by the given point_axis function.

[src]

The length of the transformed node at the given index along the x axis.

[src]

The length of the transformed node at the given index along the y axis.

[src]

The length of the transformed node at the given index along the z axis.

[src]

Drain any remaining drawings, convert them to their Drawn state and insert them into the inner mesh and geometry graph.

Trait Implementations

impl<S: Clone> Clone for Draw<S> where
    S: BaseFloat
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<S: Debug> Debug for Draw<S> where
    S: BaseFloat
[src]

[src]

Formats the value using the given formatter. Read more

impl<S> Default for Draw<S> where
    S: BaseFloat
[src]

[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations

impl<S> Send for Draw<S> where
    S: Send

impl<S = f32> !Sync for Draw<S>