Code Monkey home page Code Monkey logo

bevy_vector_shapes's Introduction

Bevy Vector Shapes

crates.io docs.rs CI Bevy 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

  • Variety of built in shape types: lines, rectangles, circles, arcs and regular polygons.
  • Traits to allow implementation of custom shape types.
  • Supports various bevy rendering features: 2D and 3D pipelines, transparency, alpha modes, render layers, bloom.
  • Canvas API for rendering shapes to a texture.
  • Ability to draw textures on shapes, including canvas textures.
  • 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 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.13 0.7.0
0.12 0.6.0
0.11 0.5.2
0.10 0.4.6

Alternatives

  • bevy_smud: for generating custom sdf expressions at run time.
  • bevy_protoype_lyon: for generating meshes from 2D shapes and paths.
  • vello: for very efficient 2D shape rendering to images.

bevy_vector_shapes's People

Contributors

james-j-obrien avatar outergod avatar elliots-bits avatar droggelbecher avatar paul-hansen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.