4ian / GDevelop

🎮 Open-source, cross-platform 2D/3D/multiplayer game engine designed for everyone.
https://gdevelop.io
Other
10.47k stars 836 forks source link

Display original resource size on the UI #6114

Open LuniMoon opened 9 months ago

LuniMoon commented 9 months ago

Is there an existing issue for this?

Describe the bug

During the internal test of the Asset Export build with @Bouh, we noticed a quick win on the app to improve UX:

While adding a local file to the Object list (tiled sprite and 9 patch), the engine always displays a value of 32x32 image

Since Bouh was exporting adding a certain amount of tiles and 9 patch objects, he had to change these values by hand to reflect the real size of the resource:

Screenshot 2023-12-20 at 15 32 54

Quick win:

When a user adds a resource, the system displays the real size of the file. For tiles might be a little tricky (D8H was concerned about negatively impacting the graphics editor). Maybe some exploration will be needed for tiles.

Steps to reproduce

N/A

GDevelop platform

Desktop, Web, Mobile

GDevelop version

5.3.181

Platform info

*OS (e.g. Windows, Linux, macOS, Android, iOS)* > *OS Version (e.g. Windows 10, macOS 10.15)* > *Browser(For Web) (e.g. Chrome, Firefox, Safari)* > *Device(For Mobile) (e.g. iPhone 12, Samsung Galaxy S21)* >

Additional context

No response

D8H commented 9 months ago

We should probably add a checkbox like in the instance editor (unchecked by default).

image

Technical solution

LuniMoon commented 9 months ago

Why do you suggest a checkbox instead of always giving the file resource size?

D8H commented 9 months ago

Otherwise, when the image resource is replaced the UI don't know if the dimensions should be kept or updated to the new image size. It would be odd to only change the dimensions for the 1st image of the 1st edition (especially if a user close the editor to add an image later)