0 votes

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)
in Engine by (25 points)

1 Answer

+1 vote
Best answer

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:
https://docs.godotengine.org/en/latest/tutorials/misc/pausing_games.html?highlight=paused

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

by (3,352 points)
selected by

thanks.
you are totally right

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.)

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.