rewar
March 7, 2026, 4:15pm
1
Godot Version
Godot 4.6.1 (mono)
Question
I’m working on a small RPG game where some elements need to act like buttons (with normal/hover/pressed/disabled states) but can contain complex information.
So I wonder how to use a Button control node but to force it to be working like a Container?
1 Like
Display the complex information in a rich text label that is displayed over the button.
Turn off mouse input for the label.
1 Like
Well in my case i use lable overlapped by button which is falt. So the label and it’s text is visible. And it’s act like button.
Make something like this:
PanelContainer
Button
VBoxContainer (or some other stuff)
Label
Label
Set the Mouse/Filter of VBoxContainer and it’s content to Ignore so that the mouse clicks go to the Button.
1 Like
I think a ButtonContainer should be added to Godot, this kind of container has been asked about a number of times and other game engines feature such an object.
For now a workaround is to create a margin container for both your button and another container with the contents of the button.
opened 03:49PM - 25 Dec 25 UTC
topic:gui
### Describe the project you are working on
Working on a nutrition planning app… so it is just user interface
### Describe the problem or limitation you are having in your project
I am working on clickable tiles / panels which can contain other nodes or multiple node
As example (picture taken from the App Yazio). The Meals "Breakfast", "lunch" etc. are clickable and change the Style when beeing pressed / hovered like the Button Node.
<img width="471" height="1000" alt="Image" src="https://github.com/user-attachments/assets/4b51dfaf-9fb0-4e81-917b-8c033fde0648" />
The "problem" is that you can use the Button Node as Background but it does not update its size to its children size. To solve this you have to set a minimum size of the button and change the childs anchor mode to full rect so it updates its size to the Button size.
### Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add a new Node which updates its size like a PanelContainer but also updates its style when different events like "Pressed", "Hovered" etc. beeing emitted (like the Button Node).
https://github.com/user-attachments/assets/c001a0e2-5b75-48ec-9acd-1a0d452440ca
### Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
In the end it is the same functionality like the Button Node but completely empty without text or icon you can set. It is just a PanelContainer with Button functionality.
### If this enhancement will not be used often, can it be worked around with a few lines of script?
You can use the default Button Node but it does not feel correct because it does not update its size to its children. Instead you have to set a minimum size and let the children fit to its parent width.
### Is there a reason why this should be core and not an add-on in the asset library?
It is a different button especially used for a lot of user interface heavy applications.
3 Likes
rewar
March 8, 2026, 8:20pm
7
Thank you everyone for your answers
The best solution I tried is to create a PanelContainer node, with a StyleBoxEmpty override, which contains the Button as its first child, and the real container as the second child.
So far, a ButtonContainer will be the best solution ; hope it will be implemented in further versions.