TinyAdventure/ui/item_grid.gd

14 lines
271 B
GDScript
Raw Normal View History

2024-07-09 22:33:38 +02:00
class_name ItemGrid
extends GridContainer
@export var slot_scene:PackedScene
func display(items:Array[Item]):
for child in get_children():
child.queue_free()
for item in items:
var slot:ItemSlot = slot_scene.instantiate()
add_child(slot)
slot.display(item)