//! This example demonstrates Bevy's immediate mode drawing API intended for visual debugging. use std::f32::consts::{PI, TAU}; use bevy::{color::palettes::css::*, prelude::*}; fn main() { App::new() .add_plugins(DefaultPlugins) .init_gizmo_group::() .add_systems(Startup, setup) .add_systems(Update, (draw_example_collection, update_config)) .run(); } // We can create our own gizmo config group! #[derive(Default, Reflect, GizmoConfigGroup)] struct MyRoundGizmos {} fn setup(mut commands: Commands, asset_server: Res) { commands.spawn(Camera2dBundle::default()); // text commands.spawn(TextBundle::from_section( "Hold 'Left' or 'Right' to change the line width of straight gizmos\n\ Hold 'Up' or 'Down' to change the line width of round gizmos\n\ Press '1' or '2' to toggle the visibility of straight gizmos or round gizmos\n\ Press 'U' or 'I' to cycle through line styles for straight or round gizmos\n\ Press 'J' or 'K' to cycle through line joins for straight or round gizmos", TextStyle { font: asset_server.load("fonts/FiraMono-Medium.ttf"), font_size: 24., color: Color::WHITE, }, )); } fn draw_example_collection( mut gizmos: Gizmos, mut my_gizmos: Gizmos, time: Res