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§

painter
Structs and components used by the ShapePainter, ShapeCommands and Canvas APIs.
prelude
use bevy_vector_shapes::prelude::* to import commonly used items.
render
Rendering specific traits and structs.
shapes
Components and Enums used to define shape types.

Structs§

BaseShapeConfig
Resource that represents the default shape config to be used by ShapePainter and ShapeCommands APIs.
Shape2dPlugin
Plugin that contains all necessary functionality to draw shapes with a 2D camera.
ShapePlugin
Plugin that contains all necessary functionality to draw shapes with a 3D or 2D camera.