Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposing a method to change the Node icon #863

Closed
paddy-exe opened this issue Sep 22, 2022 · 6 comments · Fixed by godotengine/godot#75472
Closed

Exposing a method to change the Node icon #863

paddy-exe opened this issue Sep 22, 2022 · 6 comments · Fixed by godotengine/godot#75472
Labels
enhancement This is an enhancement on the current functionality
Milestone

Comments

@paddy-exe
Copy link
Contributor

There's doesn't seem to be an exposed method or another possibility to change the icon of a node written with GDExtension.

@MGilleronFJ
Copy link

MGilleronFJ commented Sep 22, 2022

We actually need a way to specify icons in general, for resources, nodes, any object classes. So they would show in docs, Add Node dialog, Create Resource dialog, scene tree etc.

@alessandrofama
Copy link
Contributor

alessandrofama commented Sep 22, 2022

As a workaround you can call

get_editor_interface().get_base_control().get_theme().set_icon("YourGDExtensionClass", "EditorIcons", your_icon)

in an EditorPlugin and the icon will appear in all places.

@paddy-exe
Copy link
Contributor Author

paddy-exe commented Sep 23, 2022

As a workaround you can call


get_editor_interface().get_base_control().get_theme().set_icon("YourGDExtensionClass", "EditorIcons", your_icon)

in an EditorPlugin and the icon will appear in all places.

Good to know! I will try that, thanks👍🏻

@aaronfranke
Copy link
Member

@alessandrofama Unfortunately, this work-around does not seem to scale the icons. They are tiny on my 4K screen where I have the system and Godot running with 200% scaling.

@paddy-exe
Copy link
Contributor Author

@aaronfranke Do you know how much would be needed to have this exposed to GDExtension? I suppose it's too late to have it for 4.0 right?

@bitbrain
Copy link

bitbrain commented Oct 8, 2022

@aaronfranke it does scale on my 4K but only after reloading the addon (disabling and re-enabling it in the settings) However, when I restart Godot the icon is scuffed again...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is an enhancement on the current functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants