rparrett/bevy_prototype_lyon

Draw 2D shapes in Bevy

Rust

815

282 commits

updated Jun 22, 2026

See the code

README

Bevy + Lyon = ❤

Crates.io Crates.io Downloads GitHub Repo stars CI

bevy_prototype_lyon enables Bevy users to draw 2D shapes and paths, like triangles, circles, rectangles, lines, arcs and beziers.

Try out the live demo! Regular polygon demo

How does it work?

Currently Bevy does not support drawing custom shapes in an easy way. This crate uses a variation of Bevy's Mesh2d with custom meshes to draw shapes. The lyon crate is used to generate those custom meshes.

Usage

Add bevy_prototype_lyon to your cargo project:

cargo add bevy_prototype_lyon

Then, you can start by drawing simple shapes:

use bevy::{color::palettes::css::*, prelude::*};
use bevy_prototype_lyon::prelude::*;

fn main() {
    App::new()
        .add_plugins((DefaultPlugins, ShapePlugin))
        .add_systems(Startup, setup_system)
        .run();
}

fn setup_system(mut commands: Commands) {
    let shape = shapes::RegularPolygon {
        sides: 6,
        feature: shapes::RegularPolygonFeature::Radius(200.0),
        ..shapes::RegularPolygon::default()
    };

    commands.spawn((Camera2d, Msaa::Sample4));
    commands.spawn(
        ShapeBuilder::with(&shape)
            .fill(DARK_CYAN)
            .stroke((BLACK, 10.0))
            .build(),
    );
}

Don't forget to check out the examples to learn more!

Bevy versions supported

I strive to support the latest version of Bevy. Support for a version of Bevy is dropped as soon as a new one is released.

The following table shows the latest version of bevy_prototype_lyon that supports a certain version of Bevy.

bevybevy_prototype_lyonlicense
0.190.17MIT/Apache 2.0
0.180.16MIT/Apache 2.0
0.170.15MIT/Apache 2.0
0.160.14MIT/Apache 2.0
0.150.13MIT/Apache 2.0
0.140.12MIT/Apache 2.0
0.130.11MIT/Apache 2.0
0.120.10MIT/Apache 2.0
0.110.9MIT/Apache 2.0
0.100.8MIT/Apache 2.0
0.90.7MIT/Apache 2.0
0.80.6MIT/Apache 2.0
0.70.5MIT/Apache 2.0
0.60.4MIT/Apache 2.0
0.50.3MIT
0.40.2MIT

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

bevy
rust
shapes

rparrett/bevy_prototype_lyon

Draw 2D shapes in Bevy

Rust

815

282 commits

updated Jun 22, 2026

See the code

README

Bevy + Lyon = ❤

Crates.io Crates.io Downloads GitHub Repo stars CI

bevy_prototype_lyon enables Bevy users to draw 2D shapes and paths, like triangles, circles, rectangles, lines, arcs and beziers.

Try out the live demo! Regular polygon demo

How does it work?

Currently Bevy does not support drawing custom shapes in an easy way. This crate uses a variation of Bevy's Mesh2d with custom meshes to draw shapes. The lyon crate is used to generate those custom meshes.

Usage

Add bevy_prototype_lyon to your cargo project:

cargo add bevy_prototype_lyon

Then, you can start by drawing simple shapes:

use bevy::{color::palettes::css::*, prelude::*};
use bevy_prototype_lyon::prelude::*;

fn main() {
    App::new()
        .add_plugins((DefaultPlugins, ShapePlugin))
        .add_systems(Startup, setup_system)
        .run();
}

fn setup_system(mut commands: Commands) {
    let shape = shapes::RegularPolygon {
        sides: 6,
        feature: shapes::RegularPolygonFeature::Radius(200.0),
        ..shapes::RegularPolygon::default()
    };

    commands.spawn((Camera2d, Msaa::Sample4));
    commands.spawn(
        ShapeBuilder::with(&shape)
            .fill(DARK_CYAN)
            .stroke((BLACK, 10.0))
            .build(),
    );
}

Don't forget to check out the examples to learn more!

Bevy versions supported

I strive to support the latest version of Bevy. Support for a version of Bevy is dropped as soon as a new one is released.

The following table shows the latest version of bevy_prototype_lyon that supports a certain version of Bevy.

bevybevy_prototype_lyonlicense
0.190.17MIT/Apache 2.0
0.180.16MIT/Apache 2.0
0.170.15MIT/Apache 2.0
0.160.14MIT/Apache 2.0
0.150.13MIT/Apache 2.0
0.140.12MIT/Apache 2.0
0.130.11MIT/Apache 2.0
0.120.10MIT/Apache 2.0
0.110.9MIT/Apache 2.0
0.100.8MIT/Apache 2.0
0.90.7MIT/Apache 2.0
0.80.6MIT/Apache 2.0
0.70.5MIT/Apache 2.0
0.60.4MIT/Apache 2.0
0.50.3MIT
0.40.2MIT

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

bevy
rust
shapes

Project health

Latest release

0.17.0 · Jun 22, 2026

Releases this year

5

Significant stargazers

(top 24 of 29)

Guillaume Gomez

1,665 followers · starred Aug 2024

Marek Kotewicz

730 followers · starred Nov 2025

Alex Saveau

410 followers · starred Jan 2022

Max Woolf

5,107 followers · starred Jun 2022