Godot Version
4.2.1Question
After pressing the button, the BoardMenu will come up. In the BoardMenu there is a TileMap. I want after pressing the TileMap to close the BoardMenu page. How toIn GUI
extends Control
@onready var rook_cho = $MarginContainer/VBoxContainer/Rook_cho as Button
@onready var board_menu = $Board_Menu as BoardMenu
# Called when the node enters the scene tree for the first time.
func _ready():
set_process(false)
handle_connecting_signals()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _on_Rookcho_pressed() ->void:
board_menu.visible = true
func _on_exit_tile_map() ->void:
board_menu.visible = false
func handle_connecting_signals() ->void:
rook_cho.button_down.connect(_on_Rookcho_pressed)
In Board_Menu
class_name BoardMenu
extends Control
@onready var tile_map = $MarginContainer/GridContainer/Node2D/TileMap
signal exit_tile_map
var is_handling_tile_map = false
func _ready():
exit_tile_map.connect(_on_tile_map)
func _input(event: InputEvent) -> void:
if event.is_action_pressed("mouse_left") and not is_handling_tile_map:
is_handling_tile_map = true
_on_tile_map()
func _on_tile_map() -> void:
pass