Quick prototype of how switch to an icon during pickup makes the rendering bug go away and also looks better visually.
This commit is contained in:
parent
6f91533950
commit
b311713064
5 changed files with 12 additions and 2 deletions
|
@ -80,6 +80,11 @@
|
|||
"frame_width": 256,
|
||||
"frame_height": 256
|
||||
},
|
||||
"torch_horizontal_floor_ICON":
|
||||
{"path": "assets/icons/torch_crappy_ICON.png",
|
||||
"frame_width": 128,
|
||||
"frame_height": 128
|
||||
},
|
||||
"peasant_girl":
|
||||
{"path": "assets/sprites/peasant_girl_2.png",
|
||||
"frame_width": 256,
|
||||
|
@ -95,6 +100,11 @@
|
|||
"frame_width": 256,
|
||||
"frame_height": 256
|
||||
},
|
||||
"healing_potion_small_ICON":
|
||||
{"path": "assets/icons/healing_potion_small_ICON.png",
|
||||
"frame_width": 128,
|
||||
"frame_height": 128
|
||||
},
|
||||
"well_down":
|
||||
{"path": "assets/sprites/well_down.png",
|
||||
"frame_width": 256,
|
||||
|
|
BIN
assets/icons/healing_potion_small_ICON.png
Normal file
BIN
assets/icons/healing_potion_small_ICON.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
BIN
assets/icons/torch_crappy_ICON.png
Normal file
BIN
assets/icons/torch_crappy_ICON.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.5 KiB |
|
@ -75,7 +75,7 @@ namespace gui {
|
|||
dbc::check($level.world->has<components::Sprite>(item),
|
||||
"item in inventory UI doesn't exist in world. New level?");
|
||||
auto& sprite = $level.world->get<components::Sprite>(item);
|
||||
$gui.set_init<guecs::Sprite>(id, {sprite.name});
|
||||
$gui.set_init<guecs::Sprite>(id, {fmt::format("{}_ICON", sprite.name)});
|
||||
|
||||
guecs::GrabSource grabber{
|
||||
item, [&, id]() { return remove_slot(id); }};
|
||||
|
|
|
@ -80,7 +80,7 @@ namespace gui {
|
|||
auto gui_id = $gui.entity(slot);
|
||||
|
||||
auto& sprite = $level.world->get<components::Sprite>(world_entity);
|
||||
$gui.set_init<guecs::Sprite>(gui_id, {sprite.name});
|
||||
$gui.set_init<guecs::Sprite>(gui_id, {fmt::format("{}_ICON", sprite.name)});
|
||||
guecs::GrabSource grabber{ world_entity,
|
||||
[&, gui_id]() { return remove_slot(gui_id); }};
|
||||
grabber.setSprite($gui, gui_id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue