A Minecraft style clone in Godot
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

21 lines
568 B

class_name InventoryItemRect
extends Panel
@export var item_resource: ItemResource
@onready var amount_label: Label = $AmountLabel
@onready var item_texture: TextureRect = $ItemTexture
func update_rect() -> void:
item_texture.texture = load(item_resource.item_texture)
amount_label.text = "x" + str(item_resource.amount)
tooltip_text = item_resource.name
func on_stack_full(is_full: bool) -> void:
if is_full:
amount_label.add_theme_color_override("font_color", Color(1, 0, 0))
else:
amount_label.add_theme_color_override("font_color", Color(1, 1, 1))