Files
GGJ26/scenes/list/list.gd
minimata 837b994ef0
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 10s
Create tag and build when new code gets to main / Export (push) Successful in 1m30s
new font and menu tweaks, created bishop and knight character
2026-02-01 12:41:49 +01:00

48 lines
1.1 KiB
GDScript

extends Area2D
class_name List
var current_item = 0
@onready var label: Label = $Label
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func set_mask_list(items: Array[MaskResource]):
print(items)
current_item = 0
if items.size() == 0:
label.text = "..."
func set_chara_list(items: Array[CharacterResource]):
print(items)
current_item = 0
if items.size() == 0:
label.text = "..."
func cycle_through_items() -> void:
current_item += 1
print(current_item)
func _on_mouse_entered() -> void:
Input.set_default_cursor_shape(Input.CursorShape.CURSOR_POINTING_HAND)
func _on_mouse_exited() -> void:
Input.set_default_cursor_shape(Input.CursorShape.CURSOR_ARROW)
func _on_input_event(viewport: Node, event: InputEvent, shape_idx: int) -> void:
if event is InputEventMouseButton and event.is_pressed():
Input.set_default_cursor_shape(Input.CursorShape.CURSOR_ARROW)
cycle_through_items()