Module pix_engine::shape
source · 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
- A shape type representing circles and ellipses used for drawing.
- A shape type representing lines used for drawing.
- A N-dimensional shape type representing geometric points used for drawing.
- A shape type representing quadrilaterals used for drawing.
- A shape type representing squares and rectangles used for drawing.
- A shape type representing spheres used for drawing.
- A shape type representing triangles used for drawing.
Macros
- Constructs a Line with two points.
- Constructs a Point with N coordinates.
- Constructs a Quad with four points.
- Constructs a Triangle with three points.
Structs
- An
Ellipse
positioned at(x, y)
, withwidth
andheight
. A circle is anEllipse
wherewidth
andheight
are equal. - A
Line
with start and end Points. - A
Point
in N-dimensional space. - A
Quad
or quadrilateral, a four-sided polygon. - A
Rectangle
positioned at(x, y)
withwidth
andheight
. A square is aRectangle
wherewidth
andheight
are equal. - A
Sphere
positioned at(x, y, z)
withradius
. - A
Triangle
with three Points.
Traits
- Trait for shape containing operations.
- Trait for shape intersection operations.