- Edited
Hi,
this should be simple... but I am new to Godot and can't figure it out.
I have a basic Panel under the root Node with no theme assigned. I have added a theme override with a StyleBoxFlat which specifies a custom bg color, let's say yellow.
I'd like to turn the yellow bg to something else at runtime.
In the _ready() func of the root Node I do this:
func testPanel():
var style:StyleBoxFlat = StyleBoxFlat.new()
style.bg_color = Color("#cc0000")
$Panel.add_theme_stylebox_override("", style)
print("Main Panel color was changed")
The func() runs, but no joy. Also I have no idea what the "name" parameter in the add_stylebox_override() refers to.
I've googled the heck out of this and didn't find any solution. If anyone has an idea, I'd be grateful
Thanks!