Expand description
Shape methods for drawing.
Methods for drawing and interacting with shapes such as points, lines, rectangles, etc.
Provided traits:
- Contains: Defines
containsfor shapes containing other shapes. - Intersects: Defines
intersectsfor 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)withwidthandheight. - 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)withwidthandheight. - sphere
- Constructs a Sphere at position
(x, y, z)withradius. - square
- Constructs a square Rect at position
(x, y)with the samewidthandheight. - tri
- Constructs a Triangle with three points.
Structs§
- Ellipse
- An
Ellipsepositioned at(x, y), withwidthandheight. A circle is anEllipsewherewidthandheightare equal. - Line
- A
Linewith start and end Points. - Point
- A
Pointin N-dimensional space. - Quad
- A
Quador quadrilateral, a four-sided polygon. - Rect
- A
Rectanglepositioned at(x, y)withwidthandheight. A square is aRectanglewherewidthandheightare equal. - Sphere
- A
Spherepositioned at(x, y, z)withradius. - Tri
- A
Trianglewith three Points.
Traits§
- Contains
- Trait for shape containing operations.
- Intersects
- Trait for shape intersection operations.