diff --git a/examples/drag_and_drop_ui.rs b/examples/drag_and_drop_ui.rs new file mode 100644 index 0000000..b812569 --- /dev/null +++ b/examples/drag_and_drop_ui.rs @@ -0,0 +1,44 @@ +use bevy::prelude::*; +use bevy_mod_picking::prelude::*; + +fn main() { + App::new() + .add_plugins(( + DefaultPlugins, + DefaultPickingPlugins, + )) + .add_systems(Startup, init_ui) + .run(); +} + +fn init_ui( + mut commands: Commands, +) { + commands.spawn(Camera3dBundle { ..default() }); + + commands.spawn(( + NodeBundle { + style: Style { + width: Val::Px(100.0), + height: Val::Px(100.0), + top: Val::Px(0.0), + left: Val::Px(0.0), + position_type: PositionType::Absolute, + ..default() + }, + background_color: Color::WHITE.into(), + ..default() + }, + PickableBundle::default(), + On::>::target_component_mut::