Expand description
Shape methods for drawing.
Methods for drawing and interacting with shapes such as points, lines, rectangles, etc.
Provided traits:
- Contains: Defines
contains
for shapes containing other shapes. - Intersects: Defines
intersects
for shapes intersecting other shapes.
Provided PixState
methods;
PixState::point
: Draw a Point to the current canvas.PixState::line
: Draw a Line to the current canvas.PixState::triangle
: Draw a Triangle to the current canvas.PixState::square
: Draw a square Rect to the current canvas.PixState::rounded_square
: Draw a square Rect with rounded corners to the current canvas.PixState::rect
: Draw a Rect to the current canvas.PixState::rounded_rect
: Draw a Rect with rounded corners to the current canvas.PixState::quad
: Draw a Quad to the current canvas.PixState::polygon
: Draw a polygon defined by a set of Points to the current canvas.PixState::wireframe
: Draw a wireframe defined by a set vertexes to the current canvas.PixState::circle
: Draw a circle Ellipse to the current canvas.PixState::ellipse
: Draw an Ellipse to the current canvas.PixState::arc
: Draw an arc to the current canvas.
Modules§
- ellipse
- A shape type representing circles and ellipses used for drawing.
- line
- A shape type representing lines used for drawing.
- point
- A N-dimensional shape type representing geometric points used for drawing.
- quad
- A shape type representing quadrilaterals used for drawing.
- rect
- A shape type representing squares and rectangles used for drawing.
- sphere
- A shape type representing spheres used for drawing.
- triangle
- A shape type representing triangles used for drawing.
Macros§
- circle
- Constructs a circle Ellipse at position
(x, y
) withradius
. - ellipse
- Constructs an Ellipse at position
(x, y)
withwidth
andheight
. - line_
- Constructs a Line with two points.
- point
- Constructs a Point with N coordinates.
- quad
- Constructs a Quad with four points.
- rect
- Constructs a Rect at position
(x, y)
withwidth
andheight
. - sphere
- Constructs a Sphere at position
(x, y, z)
withradius
. - square
- Constructs a square Rect at position
(x, y)
with the samewidth
andheight
. - tri
- Constructs a Triangle with three points.
Structs§
- Ellipse
- An
Ellipse
positioned at(x, y)
, withwidth
andheight
. A circle is anEllipse
wherewidth
andheight
are equal. - Line
- A
Line
with start and end Points. - Point
- A
Point
in N-dimensional space. - Quad
- A
Quad
or quadrilateral, a four-sided polygon. - Rect
- A
Rectangle
positioned at(x, y)
withwidth
andheight
. A square is aRectangle
wherewidth
andheight
are equal. - Sphere
- A
Sphere
positioned at(x, y, z)
withradius
. - Tri
- A
Triangle
with three Points.
Traits§
- Contains
- Trait for shape containing operations.
- Intersects
- Trait for shape intersection operations.