Set_theme() Invalid argument, should be "Theme", but is "String"

Godot Version

1.4.2 Linux/X11

Question

set_theme(“res://dark.theme”)

on a node which inherits Control gives the error:

Invalid argument for “set_theme()” function: argument 1 should be “Theme” but is “String”.

I searched that function on the F1 Help:

the .theme is not part of any node, it’s a separate resource to be called

I could not find in F1 Help by terms like ‘theme’, what is the proper format to insert/create themes programmatically. which would be that?

Try this:

var theme = load("res://dark.theme")
set_theme(theme)

Although, a theme is usually stored as a tres resource.

1 Like

thank you very much! I forget the load thing…

1 Like

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