Skip to content

Instantly share code, notes, and snippets.

@anthonyec
Last active January 25, 2024 21:54
Show Gist options
  • Save anthonyec/bc1c9fe4cd611ba3c8911f5b83e3b66e to your computer and use it in GitHub Desktop.
Save anthonyec/bc1c9fe4cd611ba3c8911f5b83e3b66e to your computer and use it in GitHub Desktop.
Godot C++ notes

I couldn't get icons to working using this:

get_editor_theme_icon(SNAME("Pin"));

It shows as a broken icon, I think I'm missing an #include but I don't know what header file to include. Even where it does work, VSCode shows a red underline under the function name get_editor_theme_icon saying it's undefined.

I did get it working using the editor singleton though:

EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("Pin"), EditorStringName(EditorIcons));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment