Skip to main content

draw_polygon_concave

Function draw_polygon_concave 

Source
pub fn draw_polygon_concave(points: &[Vector2], color: Color)
Expand description

Draws a filled polygon that may be concave, using ear clipping. Self-intersecting polygons may not render correctly.

ยงExamples

let pts = [
    Vector2::new(100.0, 100.0), Vector2::new(200.0, 100.0),
    Vector2::new(150.0, 150.0), Vector2::new(200.0, 200.0),
    Vector2::new(100.0, 200.0),
];
draw_polygon_concave(&pts, RED);