Struct CommandBuilder2D

Public

2D wrapper for a CommandBuilder.

var p1 = new Vector2(0, 1);
var p2 = new Vector2(5, 7);

// Draw it in the XY plane
Draw.xy.Line(p1, p2);

// Draw it in the XZ plane
Draw.xz.Line(p1, p2);

Public Methods

Arc (center, start, end, [color])

Draws an arc between two points.

Arrow (from, to, [up, headSize], [color])

Draws an arrow between two points.

ArrowRelativeSizeHead (from, to, up, headFraction, [color])

Draws an arrow between two points with a head that varies with the length of the arrow.

Arrowhead (center, direction, [up], radius, [color])

Draws an arrowhead at a point.

ArrowheadArc (origin, direction, offset, [width], [color])

Draws an arrowhead centered around a circle.

Bezier (p0, p1, p2, p3, [color])

Draws a cubic bezier curve.

CatmullRom (..., [color])

Draws a...

Circle (center, radius, [...])

Draws a circle.

CircleXY (center, radius, [...])

Draws a circle in the XY plane.

CommandBuilder2D (draw, xy)
Cross (position, [size], [color])

Draws a...

DashedLine (a, b, dash, gap, [color])

Draws a dashed line between two points.

DashedPolyline (points, dash, gap, [color])

Draws a dashed line through a sequence of points.

InLocalSpace (transform)

Scope to draw multiple things relative to a transform object.

InScreenSpace (camera)

Scope to draw multiple things in screen space of a camera.

Label2D (position, text, ..., [color])

Draws a label in 3D space aligned with the camera.

Line (a, b, [color])

Draws a line between two points.

Polyline (points, [cycle], [color])

Draws lines through a sequence of points.

Pops a color from the stack.

Pops a duration scope from the stack.

Pops a line width scope from the stack.

Pops a matrix from the stack.

Pops a persist scope from the stack.

PushColor (color)

Draws everything until the next PopColor with the given color.

PushDuration (duration)

Draws everything until the next PopDuration for a number of seconds.

PushLineWidth (pixels, automaticJoins=true)

Draws all lines until the next PopLineWidth with a given line width in pixels.

PushMatrix (matrix)

Multiply all coordinates until the next PopMatrix with the given matrix.

PushPersist (duration)

Draws everything until the next PopPersist for a number of seconds.

PushSetMatrix (matrix)

Multiply all coordinates until the next PopMatrix with the given matrix.

Ray (..., [color])

Draws a ray...

SolidArc (center, start, end, [color])

Draws a solid arc between two points.

SolidCircle (center, radius, [...])

Draws a disc.

SolidRectangle (rect, [color])

Draws a solid rectangle.

SolidTriangle (a, b, c, [color])

Draws a solid triangle.

WireGrid (center, cells, totalSize, [color])

Draws a grid of lines.

WirePill (..., radius, [color])

Draws a wire pill in 2D.

WireRectangle (..., [color])

Draws a rectangle outline.

WireTriangle (..., [color])

Draws a triangle outline.

WithColor (color)

Scope to draw multiple things with the same color.

WithDuration (duration)

Scope to draw multiple things for a longer period of time.

WithLineWidth (pixels, automaticJoins=true)

Scope to draw multiple things with a given line width.

WithMatrix (matrix)

Scope to draw multiple things with an implicit matrix transformation.

Public Variables

xy

True if drawing in the XY plane, false if drawing in the XZ plane.

Public

Public Static Variables

XY_TO_XZ_ROTATION
Public Static Readonly
XY_UP
Public Static Readonly
XZ_TO_XY_MATRIX
Public Static Readonly
XZ_TO_XZ_ROTATION
Public Static Readonly
XZ_UP
Public Static Readonly

Private/Protected Members

draw

The wrapped command builder.

Private