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
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
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
Structs
An
Ellipse positioned at (x, y), with width and height. A circle is an Ellipse where
width and height are equal.A
Point in N-dimensional space.A
Quad or quadrilateral, a four-sided polygon.A
Rectangle positioned at (x, y) with width and height. A square is a Rectangle where
width and height are equal.A
Sphere positioned at (x, y, z) with radius.Traits
Trait for shape containing operations.
Trait for shape intersection operations.