More of the drag/drop is handled by the GrabSource/DropTarget components.

This commit is contained in:
Zed A. Shaw 2025-06-09 23:59:44 -04:00
parent 7a551cf83a
commit 570b70ab0c
7 changed files with 36 additions and 81 deletions

View file

@ -8,12 +8,14 @@ namespace guecs {
Clickable make_action(DinkyECS::World& target, Events::GUI event);
Clickable make_action(DinkyECS::World& target, Events::GUI event, std::any data);
struct GrabSource : public Sprite {
void grab();
struct GrabSource {
DinkyECS::Entity world_entity = 0;
DinkyECS::Entity grab();
void move(sf::Vector2i position);
};
struct DropTarget {
std::function<bool()> commit;
std::function<bool(DinkyECS::Entity entity)> commit;
};
}