1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-07-05 01:32:13 +08:00
Files
Dog-Lynx-And-HCN/scripts/Statemachine/ItemShow.gd
T

20 lines
557 B
GDScript
Raw Normal View History

@tool
extends HBoxContainer
class_name ItemShow
@export var type: ItemStore.ItemType = ItemStore.ItemType.BASEBALL
@export var count: int = 0
@onready var avatarTexture: TextureRect = $"%avatar"
@onready var countLabel: Label = $"%count"
func _physics_process(_delta):
avatarTexture.texture = ItemStore.getTexture(type)
countLabel.text = str(count)
2025-08-28 06:49:50 +08:00
static func generate(itemType: ItemStore.ItemType, itemCount: int = 1):
var item = preload("res://components/UI/ItemShow.tscn").instantiate()
item.type = itemType
item.count = itemCount
return item