bevy_dragndrop

Crates.iobevy_dragndrop
lib.rsbevy_dragndrop
version0.2.0
sourcesrc
created_at2023-11-09 00:57:55.271221
updated_at2023-11-10 20:47:08.71448
descriptionA simple crate to make implementing drag and drop functionality much easier for the bevy ECS engine.
homepage
repositoryhttps://github.com/cadyn/bevy_dragndrop
max_upload_size
id1029568
size331,566
Cadyn (cadyn)

documentation

README

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.

Commit count: 13

cargo fmt