Module pix_engine::shape::ellipse

source ·
Expand description

A shape type representing circles and ellipses used for drawing.

Examples

You can create an Ellipse or circle using Ellipse::new or Ellipse::circle:

use pix_engine::prelude::*;

let e = Ellipse::new(10, 20, 100, 200);
let c = Ellipse::circle(10, 20, 100);

…or by using the ellipse! circle! macros:

use pix_engine::prelude::*;

let e = ellipse!(10, 20, 100, 200);
let c = circle!(10, 20, 100);

// using a point
let e = ellipse!([10, 20], 100, 200);
let e = ellipse!(point![10, 20], 100, 200);
let c = circle!([10, 20], 100);
let c = circle!(point![10, 20], 100);

Structs

  • An Ellipse positioned at (x, y), with width and height. A circle is an Ellipse where width and height are equal.