bevy_mod_gizmos

Crates.iobevy_mod_gizmos
lib.rsbevy_mod_gizmos
version0.4.0
sourcesrc
created_at2022-07-07 09:45:22.530976
updated_at2023-03-07 02:20:33.522709
descriptionVisual gizmos to aid with development and debugging in Bevy
homepage
repositoryhttps://github.com/LiamGallagher737/bevy_mod_gizmos
max_upload_size
id621082
size254,279
Liam Gallagher (LiamGallagher737)

documentation

README

Visual Gizmos for Bevy

Visual gizmos to aid with development and debugging in Bevy

bevy tracking build status github crates.io docs.rs

Demo

This examples showcases all built-in gizmo types and interactions. Try hovering and clicking the center gizmo!

cargo run --example demo 
Demo Example Screenshot

Setup

Add the following to your Cargo.toml

bevy_mod_gizmos = "0.4.0"

Add this to any file you want to use gizmos in

use bevy_mod_gizmos::*;

Add the plugin to your app

.add_plugin(GizmosPlugin)

For interactive gizmos add the following bundle when spawning your camera

GizmoInteractionCamera::default()

To increase performance I recommend the following in your Cargo.toml

[profile.dev.package."*"]
opt-level = 3

Usage

Draw a single gizmo

draw_gizmo(gizmo);

Draw multiple gizmos

draw_gizmos(vec![gizmo, gizmo, gizmo]);

Draw multiple gizmos and a connecting line

draw_gizmos_with_line(vec![gizmo, gizmo, gizmo]);

Draw a line

draw_line(points, color);

Draw a closed line

draw_closed_line(points, color);

Interactions

Gizmo::new(translation, size, color).on_click(|| println!("Clicked!"))
Gizmo::new(translation, size, color).on_hover(|| println!("Hovered!"))
Gizmo::new(translation, size, color).on_click_system(|time: Res<Time>| ...)
Gizmo::new(translation, size, color).on_hover_system(|query: Query<&Transform>| ...)

Bevy Tracking

Bevy bevy_mod_gizmos
main development
0.10 0.4.0
0.9 0.3.1
0.7 0.1.1

License

All code in this repository is dual-licensed under either:

at your option. This means you can select the license you prefer! This dual-licensing approach is the de-facto standard in the Rust ecosystem and there are very good reasons to include both.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 75

cargo fmt