Move now works better, and the API is a lot cleaner. Now just need to make it not crash.
This commit is contained in:
parent
be7b86a913
commit
e01e697535
5 changed files with 26 additions and 15 deletions
|
@ -21,11 +21,20 @@ namespace guecs {
|
|||
}
|
||||
|
||||
DinkyECS::Entity GrabSource::grab() {
|
||||
fmt::println("grab! {}", world_entity);
|
||||
return world_entity;
|
||||
}
|
||||
|
||||
void GrabSource::move(sf::Vector2i position) {
|
||||
fmt::println("move! {} to {},{}", world_entity, position.x, position.y);
|
||||
void GrabSource::setSprite(guecs::UI& gui, DinkyECS::Entity gui_id) {
|
||||
dbc::check(gui.has<guecs::Sprite>(gui_id), "GrabSource given sprite gui_id that doesn't exist");
|
||||
|
||||
auto& sp = gui.get<guecs::Sprite>(gui_id);
|
||||
sprite = sp.sprite;
|
||||
}
|
||||
|
||||
void GrabSource::move(sf::Vector2i pos) {
|
||||
if(sprite) {
|
||||
sprite->setPosition({
|
||||
float(pos.x), float(pos.y)});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue