How to customise OptionButton popup

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By abelgutierrez99

Hi,

Do you know how can I customize the PopupMenu of a OptionButton?

I tried things like option_menu.get_popup().set("font_size", 40), but nothing changes. I tried to change font size, but I would also like to change how it looks in general (background, font size and color…).

Thanks!

:bust_in_silhouette: Reply From: jgodfrey

Are you specifically trying to modify it via code? While that’s possible, the easiest way is probably to create a theme for it, which can be done directly in the editor. Here’s a pretty good overview video on how to do that in Godot 4.x.

:bust_in_silhouette: Reply From: abelgutierrez99

I was trying to modify it under the MenuButton in my theme. Now I realized that I have to modify PopupMenu theme instead.