Taking things from the LootUI to the StatusUI works way better now and there's a DropTarget to match the GrabSource.
This commit is contained in:
parent
842aac3127
commit
461ad03d27
8 changed files with 93 additions and 70 deletions
|
@ -9,20 +9,11 @@ namespace guecs {
|
|||
Clickable make_action(DinkyECS::World& target, Events::GUI event, std::any data);
|
||||
|
||||
struct GrabSource : public Sprite {
|
||||
void grab(sf::RenderWindow& window) {
|
||||
window.setMouseCursorVisible(false);
|
||||
sprite->setOrigin({128, 128});
|
||||
}
|
||||
|
||||
void move(sf::Vector2i position) {
|
||||
sprite->setPosition({
|
||||
float(position.x),
|
||||
float(position.y)
|
||||
});
|
||||
}
|
||||
void grab(sf::RenderWindow& window);
|
||||
void move(sf::Vector2i position);
|
||||
};
|
||||
|
||||
struct DropTarget {
|
||||
|
||||
std::function<bool()> action;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue