use bevy::prelude::*;
use bevy_vector_shapes::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(ShapePlugin::default())
.add_systems(Startup, setup)
.add_systems(Update, draw)
.run();
}
fn setup(mut commands: Commands) {
commands.spawn((
Camera3d::default(),
Transform::from_translation(Vec3::new(0.5, 0.3, 2.0)).looking_at(Vec3::ZERO, Vec3::Y),
));
}
fn draw(mut painter: ShapePainter) {
painter.color = Color::BLACK.with_alpha(0.9);
painter.corner_radii = Vec4::splat(0.1);
painter.rect(Vec2::new(2.0, 1.0));
painter.color = Color::WHITE;
painter.origin = Some(Vec3::Z * 0.01);
painter.set_translation(Vec3::X * -0.5);
painter.circle(0.2);
painter.set_translation(Vec3::X * 0.5);
painter.circle(0.2);
}