Shape

Figure description structure.

struct Shape (
T : float
) if (
isNumeric!T &&
isMutable!T
&&
isSigned!T
) {}

Members

Aliases

Type
alias Type = T
Undocumented in source.
bottom
alias bottom = endY
Undocumented in source.
left
alias left = x
Undocumented in source.
right
alias right = endX
Undocumented in source.
top
alias top = y
Undocumented in source.

Functions

end
void end(Vector!T vec)

The end of the figure.

move
void move(Vector!T pos)

Move shape

scale
void scale(T k)

Resizes as a percentage.

to
R to()

Converting a form to another form of its presentation.

toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

begin
Vector!T begin [@property getter]

The beginning of the figure.

begin
Vector!T begin [@property setter]

The beginning of the figure.

end
Vector!T end [@property getter]

The end of the figure.

endX
T endX [@property getter]

The end of the figure along the x-axis.

endY
T endY [@property getter]

The end of the figure along the y-axis.

height
T height [@property getter]

Shape height

height
T height [@property setter]

Shape height

length
T length [@property getter]

Line length.

length
T length [@property setter]

Line length.

radius
T radius [@property getter]
T radius [@property setter]

The radius the figure.

vertex
Vector!T vertex [@property getter]
Vector!T vertex [@property setter]

The top of the triangle.

vertexs
Vector!T[] vertexs [@property getter]

The top of the triangle.

width
T width [@property getter]

Shape width

width
T width [@property setter]

Shape width

x
T x [@property getter]

The beginning of the figure along the x-axis.

x
T x [@property setter]

The beginning of the figure along the x-axis.

y
T y [@property getter]

The beginning of the figure along the y-axis.

y
T y [@property setter]

The beginning of the figure along the y-axis.

Static functions

Circle
Shape!T Circle(Vector!T pos, T r)

Creates a circle.

CircleLine
Shape!T CircleLine(Vector!T pos, T r)
Undocumented in source. Be warned that the author may not have intended to support it.
Line
Shape!T Line(Vector!T begin, Vector!T end)

Creates a line from two points.

Multi
Shape!T Multi(Shape!T[] shapes, Vector!T pos)

Collects several figures into one.

Point
Shape!T Point(Vector!T point)

Creates a point.

Polygon
Shape!T Polygon(Vector!T[] points, Vector!T pos)

Returns the shape as a polygon.

Rectangle
Shape!T Rectangle(Vector!T begin, Vector!T end)

Creates a rectangle.

RectangleLine
Shape!T RectangleLine(Vector!T begin, Vector!T end)

Create a non-solid rectangle.

RoundRectangle
Shape!T RoundRectangle(Vector!T begin, Vector!T end, T radius)
Undocumented in source. Be warned that the author may not have intended to support it.
RoundRectangleLine
Shape!T RoundRectangleLine(Vector!T begin, Vector!T end, T radius)
Undocumented in source. Be warned that the author may not have intended to support it.
Square
Shape!T Square(Vector!T pos, T len)

Create a square.

Triangle
Shape!T Triangle(Vector!T[3] vertexs)

Creates a triangle.

TriangleLine
Shape!T TriangleLine(Vector!T[3] vertexs)

Creates a non-filled triangle.

Variables

data
Vector!T[] data;

Polygon data

isSolid
bool isSolid;

Is the polygon solid?

shapes
Shape!T[] shapes;

A set of figures. Needed for the type when you need to make one shape from several.

type
ShapeType type;

Shape type

Meta