#drag #bevy #drop #object #dropping #world #dropped

bevy_dragndrop

A simple crate to make implementing drag and drop functionality much easier for the bevy ECS engine

3 unstable releases

0.2.0 Nov 10, 2023
0.1.1 Nov 10, 2023
0.1.0 Nov 9, 2023

#1445 in Game dev

MIT/Apache

215KB
383 lines

About

This is a simple crate that I've made because I realized the lack of existing crates to implement simple drag and drop functionality for bevy. This crate supports drag and drop for both UI and 2d world objects with options for modifiers and other mouse buttons. Contributions and issues for bug reports or feature requests are welcome.

Usage

Usage is designed to be simple and leave most of the control in the hands of you. The main components you'll need are bevy_dragndrop::Draggable and bevy_dragndrop::Receiver These components can be attached to any entity with at minimum a transform and GlobalTransform. They are also compatible with NodeBundles.

Once you have entities with these components, you will be able to make use of the four events that the library provides to actually provide functionality based on the dragging and dropping. The four events include Dropped, Dragged, HoverChanged, and DragAwait

See the examples for detailed usage, as well as the docs at https://docs.rs/bevy_dragndrop/0.1.0/bevy_dragndrop/

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~40–77MB
~1.5M SLoC