TextureButton and PopupPanel problem

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: 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)
:bust_in_silhouette: Reply From: wombatstampede

Seems like you’re sawing on the branch you’re sitting on.

My guess is that you forgot to whiteliste the texture button. See here:

You need to set the pause mode to “process” for that button.

thanks.
you are totally right

Abdulrahman | 2019-02-09 18:29

Oh wow! I was having trouble with a button being the child of the pause screen popup not emitting any signals and this was exactly my problem! Now my output will print the info that the button was pressed (now I just need to connect that to un-pausing my game.)

TheNewGrant | 2020-09-21 22:50