Crate bevy_vector_shapes

Source
Expand description

bevy_vector_shapes is a library for easily and ergonomically creating instanced vector shapes in Bevy.

§Usage

See the the examples for more details on all supported features.

use bevy::prelude::*;
// Import commonly used items
use bevy_vector_shapes::prelude::*;
fn main() {
    App::new()
        .add_plugins((
            DefaultPlugins,
            // Add the shape plugin:
            // - Shape2dPlugin for 2D cameras
            // - ShapePlugin for both 3D and 2D cameras
            Shape2dPlugin::default(),
        ))
        .add_systems(Startup, setup)
        .add_systems(Update, draw)
        .run();
}
fn setup(mut commands: Commands) {
    // Spawn the camera
    commands.spawn(Camera2d);
}
fn draw(mut painter: ShapePainter) {
    // Draw a circle
    painter.circle(100.0);
}

Modules§

Structs§