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

@icon not works with PNG on the FileSystem #93221

Closed
MikeSchulze opened this issue Jun 16, 2024 · 3 comments
Closed

@icon not works with PNG on the FileSystem #93221

MikeSchulze opened this issue Jun 16, 2024 · 3 comments
Labels

Comments

@MikeSchulze
Copy link

Tested versions

v4.3.dev6.mono.official [89850d5]

System information

Windows 11

Issue description

I have tested around using custom resource icons and find it is not working with PNG as image.
The File System is not showing the icon, but the Node inspector it shows.

image

Steps to reproduce

Create a simple script and use a PNG format icon

@icon("res://test-suite.png")
class_name ScriptWithIcon
extends Node

Minimal reproduction project (MRP)

n/a

@dalexeev
Copy link
Member

I have tested around using custom resource icons and find it is not working with PNG as image.

Does this work with SVG or some other format? Or does the FileSystem dock not display class icons at all (which might make sense since FileSystem displays file/resource types, not classes)? Please describe the problem more precisely, avoid details that are not important. Thanks!

@MikeSchulze
Copy link
Author

Sorry for the confusion, I was guessing the @icon works in general and not only for resources.

I rebuild my examples as resource and saved, and it works for SVG and PNG
image

But I would swear that I had seen one of my GDScripts in the FileSystemDock with the icon when testing with Godot 4.3.beta1, only the extended classes did not have the icon.
The GDScript is just defined like:

@icon("res://addons/XXX/logo.png")
class_name ByClass
extends Node

But I can't reproduce it anymore. I have no idea what's going on here ;)
The resource file with the icon is working, so I close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants