Bevy Vector Shapes
[](https://crates.io/crates/bevy_vector_shapes)
[](https://docs.rs/bevy_vector_shapes)
[](https://github.com/james-j-obrien/bevy_vector_shapes/actions?query=workflow%3A%22Rust%22+branch%3Amain)
[](https://github.com/bevyengine/bevy/blob/main/docs/plugins_guidelines.md#main-branch-tracking)
What is Bevy Vector Shapes?
Bevy Vector Shapes is a library for easily and ergonomically creating instanced vector shapes in Bevy Engine.
WARNING
Bevy Vector Shapes is in the very early stages of development. There may be issues and some documentation may be sparse.
Features
- Variety of shape types: lines, rectangles, circles, arcs and regular polygons.
- Supports various bevy rendering features: 2D and 3D pipelines, transparency, alpha modes, render layers, bloom.
- Immediate and retained mode.
- Local anti-aliasing for smoother looking shapes.
- Optional billboarding for each shape type to ensure they are always facing the camera.
- Shapes of the same type and rendering configuration are fully instanced together.
- Compilation to wasm to run your projects in the browser.
Usage
See the minimal_2d
or minimal_3d
examples for basic usage and the remaining examples for explorations of supported features.
```rust
use bevy::prelude::;
// Import commonly used items
use bevy_vector_shapes::prelude::;
fn main() {
App::new()
.addplugins(DefaultPlugins)
// Add the shape plugin, ShapePlugin for 3D cameras and Shape2dPlugin for 2D cameras
.addplugin(Shape2dPlugin::default())
.addstartupsystem(setup)
.add_system(draw)
.run();
}
fn setup(mut commands: Commands) {
// Spawn the camera
commands.spawn(Camera2dBundle::default());
}
fn draw(mut painter: ShapePainter) {
// Draw a circle
painter.circle(100.0);
}
```
| bevy | bevyvectorshapes |
| ---- | ------------------ |
| 0.10 | 0.3.4 |