challenge-editor/scene/difficulty_selection.gd

44 lines
1.3 KiB
GDScript3
Raw Normal View History

2024-09-13 17:55:00 +08:00
extends Control
2024-09-18 17:57:10 +08:00
signal back
2024-09-20 12:02:11 +08:00
signal select(ind:int)
2024-09-13 17:55:00 +08:00
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
2024-09-18 17:57:10 +08:00
func _on_back_pressed() -> void:
back.emit()
pass # Replace with function body.
2024-09-20 12:02:11 +08:00
func _on_texture_rect_pressed() -> void:
2024-09-20 17:31:23 +08:00
Global.now_game_data["difficulty"]=0
2024-09-20 12:02:11 +08:00
select.emit(0)
pass # Replace with function body.
func _on_texture_rect_2_pressed() -> void:
2024-09-20 17:31:23 +08:00
Global.now_game_data["difficulty"]=1
2024-09-20 12:02:11 +08:00
select.emit(1)
pass # Replace with function body.
func _on_texture_rect_3_pressed() -> void:
2024-09-20 17:31:23 +08:00
Global.now_game_data["difficulty"]=2
2024-09-20 12:02:11 +08:00
select.emit(2)
pass # Replace with function body.