This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

Hello everyone,

In my game when a level is either completed or failed, I am spawning a child scene. The child scene has buttons such as MENU, RESTART & NEXT buttons. It also has level number, show earned stars etc. The scenes are made using control nodes & they are looking nice. I AM NOT USING POPUP NODES.

Above is working properly, but I am posting the question because now I want to make more such scenes (for rate-us, share app etc) which when required will popup above the main scene. And I want to know whether whatever I am doing is a good/normal approach.

I am confused about popup nodes such as WindowDialog, PopupDialog, PopupPanel etc. Can I use these popup nodes to build similar scenes (or making the popups inline in code only)? I have searched on net but could't find any good example of popup nodes having fancy looks which can be used in games. Thanks!

Godot version 3.3
in Engine by (56 points)

1 Answer

+1 vote
Best answer

All a popup node is just a control node that has special methods for hiding and showing itself. For the PopupPanel node, you're meant to style it yourself and add the children yourself. WindowDialog is for more specific use cases and you probably don't want to use it for your use case.

Your approach is fine. Popup nodes are just a shortcut for making elements that display over everything else.

by (8,580 points)
selected by

Thank you very much.

Following your suggestions, I also created child scene having a PopupPanel as root node, added it as child & then use popup() to show it. I styled the same as required using StyleBoxFlat style.

The advantage I found using it is that if user clicks outside of the panel it will close or I can make it exclusive if required. Thanks again!

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.