first circle try
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
use std::f32::consts::PI;
|
||||
|
||||
use bevy::prelude::*;
|
||||
use bevy_prototype_lyon::prelude::*;
|
||||
|
||||
fn main() {
|
||||
App::new()
|
||||
.insert_resource(Msaa { samples: 4 })
|
||||
.add_plugins(DefaultPlugins)
|
||||
.add_plugin(ShapePlugin)
|
||||
.add_startup_system(setup_system)
|
||||
.run();
|
||||
}
|
||||
|
||||
fn setup_system(mut commands: Commands) {
|
||||
let mut path_builder = PathBuilder::new();
|
||||
path_builder.move_to(Vec2::new(100., 0.));
|
||||
path_builder.arc(
|
||||
100.0 * Vec2::ZERO,
|
||||
100.0 * Vec2::ONE,
|
||||
90f32.to_radians(),
|
||||
0.,
|
||||
);
|
||||
let line = path_builder.build();
|
||||
|
||||
commands.spawn_bundle(Camera2dBundle::default());
|
||||
commands.spawn_bundle(GeometryBuilder::build_as(
|
||||
&line,
|
||||
DrawMode::Stroke(StrokeMode::new(Color::BLACK, 10.0)),
|
||||
Transform::default(),
|
||||
));
|
||||
}
|
||||
Reference in New Issue
Block a user