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

Node icon is too big in Inspector #68962

Closed
ygingras opened this issue Nov 21, 2022 · 5 comments · Fixed by #75472
Closed

Node icon is too big in Inspector #68962

ygingras opened this issue Nov 21, 2022 · 5 comments · Fixed by #75472

Comments

@ygingras
Copy link

Godot version

4.0 beta5

System information

Ubuntu 22.04.1 LTS

Issue description

I have a node with the following definition:

class_name Weapon
@icon("res://assets/opencliparts/sword_01.svg") 

The icon showed up fine in the scene tree, but in the Node Inspector, it takes the whole width of the inspector pane and obscures some of the fields.

Screenshot from 2022-11-21 09-13-58

Screenshot from 2022-11-21 09-12-59

Here is the file that I'm using as the node icon:
sword_01
CC0 openclipart.org

Steps to reproduce

Create a node with @icon("res://sword_01.svg") using the attached file. Inspect the node.

Minimal reproduction project

N/A

@TamerSoup625
Copy link

TamerSoup625 commented Nov 21, 2022

This happens because it renders the sword with the original texture size in the inspector. It is scaled appropiatly in the scene tree, but on the inspector it renders at the original size (533x533 in this case).

You can fix this by importing the texture with a 32x32 size (common size of all icons) by either modifying the .svg file or using the import dock in the editor.

Edit: I first said "16x16 size", but I found out the icon size should be 32x32 (see comment thread)

@Calinou
Copy link
Member

Calinou commented Nov 21, 2022

Related to #36981. While we should aim to fix this issue, it'd also help to warn when textures larger than 32×32 as class icons. Non-square textures could also have a warning.

@ygingras
Copy link
Author

Oh yeah, setting size-limit to 16 in the import dock after double clicking on the file then clicking the "re-import" button solves the problem. Setting the size-limit to 32 makes the image overflow just a little bit in the inspector, which looks rather good so that's what I went for.

We can close this if the import settings are the right solution for this. Mentioning the 16x16 size recommendation in the @icon() documentation would be a good idea in any case.

@Calinou
Copy link
Member

Calinou commented Nov 21, 2022

Mentioning the 16x16 size recommendation in the @ICON() documentation would be a good idea in any case.

32×32 is recommended, so that the icon looks good on hiDPI displays.

@KoBeWi
Copy link
Member

KoBeWi commented Nov 22, 2022

Related to #57286, except this one is about class_name.

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