Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Abdulrahman |
I`m creating an interface for my game, however i tried to create a popup button if pressed the game will show a popup panel.
my problem is with the TextureButton
, when i press this button, i cant press it again. the signal will not be triggered twice. (button_up) and i tried all the signal the same thing happen.
sample of the code :
extends Control
var is_popup = false
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func _on_PauseButton_button_up():
print('pressed')
if !is_popup:
get_node("PopupPanel").popup()
get_tree().paused = true
get_parent().get_node("ColorRect").visible = true
is_popup = true
get_node("PauseButton").set_pressed(true)
elif is_popup:
get_node("PopupPanel").hide()
get_tree().paused = false
get_parent().get_node("ColorRect").visible = false
is_popup = false
get_node("PauseButton").set_pressed(false)