james-j-obrien / bevy_vector_shapes

A library for rendering vector shapes using the Bevy game engine
Other
338 stars 23 forks source link

Bevy Vector Shapes

[![crates.io](https://img.shields.io/crates/v/bevy_vector_shapes)](https://crates.io/crates/bevy_vector_shapes) [![docs.rs](https://docs.rs/bevy_vector_shapes/badge.svg)](https://docs.rs/bevy_vector_shapes) [![CI](https://github.com/james-j-obrien/bevy_vector_shapes/workflows/Rust/badge.svg?branch=main)](https://github.com/james-j-obrien/bevy_vector_shapes/actions?query=workflow%3A%22Rust%22+branch%3Amain) [![Bevy tracking](https://img.shields.io/badge/Bevy%20tracking-released%20version-lightblue)](https://github.com/bevyengine/bevy/blob/main/docs/plugins_guidelines.md#main-branch-tracking) Bevy Vector Shapes

What is Bevy Vector Shapes?

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

WARNING

Bevy Vector Shapes is in the early stages of development. You may encounter issues, but feel free to report them.

Features

Usage

See basic usage below and 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
        .add_plugins(Shape2dPlugin::default())
        .add_systems(Startup, setup)
        .add_systems(Update, 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 bevy_vector_shapes
0.15 0.9.2
0.14 0.8.2
0.13 0.7.0
0.12 0.6.0
0.11 0.5.2
0.10 0.4.6

Alternatives