Compare commits
No commits in common. '57e8caa1b76043f142d271f581c300dee5941a2d' and '3fe21d45e91189e0fa2d0c8257ef7f541f46e146' have entirely different histories.
57e8caa1b7
...
3fe21d45e9
@ -1,31 +0,0 @@
|
||||
//! A minimal 2d example.
|
||||
|
||||
use bevy::{prelude::*, sprite::MaterialMesh2dBundle};
|
||||
use bevy_mod_picking::prelude::*;
|
||||
|
||||
fn main() {
|
||||
App::new()
|
||||
.add_plugins(DefaultPlugins.set(low_latency_window_plugin()))
|
||||
.add_plugins(DefaultPickingPlugins)
|
||||
.insert_resource(DebugPickingMode::Normal)
|
||||
.add_systems(Startup, setup)
|
||||
.run();
|
||||
}
|
||||
|
||||
/// Set up a simple 2D scene
|
||||
fn setup(
|
||||
mut commands: Commands,
|
||||
mut meshes: ResMut<Assets<Mesh>>,
|
||||
mut materials: ResMut<Assets<ColorMaterial>>,
|
||||
) {
|
||||
commands.spawn(Camera2dBundle::default());
|
||||
commands.spawn((
|
||||
MaterialMesh2dBundle {
|
||||
mesh: meshes.add(Rectangle::default()).into(),
|
||||
transform: Transform::default().with_scale(Vec3::splat(128.)),
|
||||
material: materials.add(ColorMaterial::from(Color::PURPLE)),
|
||||
..default()
|
||||
},
|
||||
PickableBundle::default(), // <- Makes the mesh pickable.
|
||||
));
|
||||
}
|
||||
Loading…
Reference in New Issue