Cant get sub menus to be transparent

Godot Version

4.2.1

Question

hey yall, sort of a noobie question, but im trying to make these sub menus transparent using .get_popup().transparent_bg = true , but it just doesn’t work, every other part of the window can get transparent, what am i missing? thank you

image

In theory, it should work like this:

var menu : PopupMenu = $MenuButton.get_popup()

# to remove the background of the drop down menu
menu.add_theme_stylebox_override("panel", StyleBoxEmpty.new())
# to remove the background of the currently hovered item
menu.add_theme_stylebox_override("hover", StyleBoxEmpty.new())

However, the first line doesn’t seem to work. Not sure if that’s a bug. You can assign it a StyleBoxFlat and change it’s bg_color – but transparency still won’t work.

1 Like

Hey, just figured out the problem, looks like disabling “embed sub menus” breaks transparency on drop down menus specifically, not sure if it’s a godot bug but enabling the option instantly fixes it! thanks for the reply :slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.