objectiveness is not related to talking about everything;
second, an introductory tutorial should not talk about everything an engine does, but as I said, the basic. it also teaches you how to use and instantiane multiple scenes, which help for what you wanted: show the popup when the button is pressed. just instantiate it when pressed, then queue_free() it when closing, either that or hide() and show() the popup as a child of thr button.
also, tip: don’t show screenshot of code, just send the text formated inside ```, which makes the text monospaced in the forum and easy to read. you can send an image of the scene tree.
well, you can get a node with $path_to_subnode or get_parent().get_node(‘nodepath’) for a sibling node, so you can make the popup as s child of button, and when the button is pressed (verified by the “on_pressed()” signal), you can do something like:
if $popup.is_visible() == true:
$popup.hide()
else:
$popup.show()
you may want to make a function out of it, if you use it too much:
func toggle_visibility(whose):
if whose.is_visible() == true:
whose.hide()
else:
whose.show()
So, in the first case, before the script, I added a pressed signal and then the script, the console did not show any errors, but when I pressed the button, Godot crashed. In the second script, the console asked to add a pressed signal, but I couldn’t do it because the space was already occupied by the function toggle_visibility , After pressing the button nothing happens.
could you put it in a code block? it is good practise to always put code in code blocks, they write like this:
```
code here
```
and they would appear like this:
code here
is your code properly indented? it does not seem to be from your message.
also, I don’t get what you mean by ‘the engine prohibits having two functions’, it does not, you can have any amount of functions in a script.
you said the first line is toggle_visibility, did you remove ‘extends X’, where X is the class of the node?
you don’t need to add the ‘signal pressed’ manually, signals are on the rightmost, by side of the inspector, in the Node tab, just click on the signal you want, and the node with the script you want, and Ok, it will add the signal. you don’t need to write ‘signal _signal_name’
if you remove the signal’s function, make sure to disconnect it from the node tab
that’s the window you created with the code on on_pressed()
you should be able to press F10, or “Help”, and search for stuff;
search the Popup properties (just “Popup”, open it, and it will open everything about it). search for an equivalent for the title and text. I believe it should be just title and text, but check it out first
No problem, I understand your confusion as a beginner. After work, provide more details on what you’ve tried so far, and I’ll be happy to walk through creating the pop-up window step-by-step in a friendly manner.