challenge-editor/scene/difficulty_selection.gd
2024-09-20 17:31:23 +08:00

44 lines
1.3 KiB
GDScript

extends Control
signal back
signal select(ind:int)
const JUXING_15 = preload("res://res/ui/ui_018_difficulty_selection/juxing15.png")
@onready var t_button:Array[TextureButton]=[$CenterContainer/HBoxContainer/TextureRect, $CenterContainer/HBoxContainer/TextureRect2, $CenterContainer/HBoxContainer/TextureRect3]
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
var new_bit_map=BitMap.new()
new_bit_map.create_from_image_alpha(JUXING_15.get_image(),0.01)
for i in t_button:
i.texture_click_mask=new_bit_map
i.button_down.connect(ToolButton.static_on_button_down.bind(i))
i.button_up.connect(ToolButton.static_on_button_up.bind(i))
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_back_pressed() -> void:
back.emit()
pass # Replace with function body.
func _on_texture_rect_pressed() -> void:
Global.now_game_data["difficulty"]=0
select.emit(0)
pass # Replace with function body.
func _on_texture_rect_2_pressed() -> void:
Global.now_game_data["difficulty"]=1
select.emit(1)
pass # Replace with function body.
func _on_texture_rect_3_pressed() -> void:
Global.now_game_data["difficulty"]=2
select.emit(2)
pass # Replace with function body.