More of the drag/drop is handled by the GrabSource/DropTarget components.
This commit is contained in:
parent
7a551cf83a
commit
570b70ab0c
7 changed files with 36 additions and 81 deletions
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue