How can I increase the size of the Options Button pop up?

Godot Version

Version 4.2

Question

Not much to say other than the fact I’m working on a pong game and I’ve been trying to increase the size of the PopUp menu from the options button. There doesn’t seem to be anyway to do so from the theme editor and no options in the inspector.


Is there any way to make it bigger than this so it matches the button size and is easier to read?

You could try this:

$PopupMenu.add_theme_font_size_override("font_size", 72)

Then if it works just change 72 to whatever font size you need

I’m trying to change the size of the menu, not the font. And even if I wanted to do that, I could still do it in the theme editor.

Any other suggestions?

Oh sorry, I misunderstood what you wanted. If it’s the area the options are displayed in, then Size under the Window section in the inspector does it.

popup

Or in Script

	$PopupMenu.size.x = 100 # change to whatever size you want
	$PopupMenu.size.y = 100 # change to whatever size you want

Hopefully I got the right bit this time.

Looks like it could work, but where can I find the windows section in the inspector? I can’t really see it anywhere.

Or is there some other node I have to select to get this feature?

I’m using the PopupMenu node, it just shows up in the inspector.

You could try putting size in the filter box and see if it comes up. If not, then I have no idea, but setting it using code should still work.

Is there a way for me to access and increase the size of the pop menu that’s within the options button? The popup menu I’m referring to only exists in the theme editor:

Just for more clarification, the pop up menu I have is a type in the theme editor, not a node.

Ok, if you click on Override All in the Theme Editor. Then go back to the inspector and click on Theme, you should now see a PopUpMenu section like below (it’s expanded here since I was just having a look through it)

You should hopefully be able to set the options you need in here to get what you were after.

I’ll play around and see which option does what I need, Thanks!

I’ve tried out most of the options in the constants, but they only affect the fonts and not the panel itself. Even overriding the PopUp Panel didn’t do much since it only had a panel stylebox with nothing else to change.

Any, other suggestions?

Item End Padding Can be used to extend the width of the popup, but for the height I cant really see anything other than increasing V Separation to increase the distance between the options and possibly increasing the font size to force it bigger.
Other than that I think I’m out of ideas, sorry.

I’ll try increasing the end padding and v separation more to see if that works, Thanks!

The end padding just increased the width, and the v seperation just made the options have a lot of space, it didn’t really increase the size overall.

Is there really not a way to achieve this?

I think this is my last idea, if this isn’t it then I’m not sure I’m trying to get it to do what you want it to.

In the inspector for the Option Button:

Disable Fit to longest Item
Change Text overrun behaviour to Trim Characters

Next you need to connect the pressed() signal of BaseButton to your script

In

func _on_option_button_pressed() -> void:

add in

	$OptionButton.get_popup().size.x = 500
	$OptionButton.get_popup().size.y = 500

See if works.

Can I just try adding or accessing something like this only?

I’m not sure what you mean?

Ignore all of this, because I don’t feel like it’s necessary for increasing the window size

Try it and see what works best for you, they’re just cosmetic, you can always do them later if you need to.

1 Like

It says that get_popup() isn’t an existent function, which other function should I try?