GDevelop icon indicating copy to clipboard operation
GDevelop copied to clipboard

Display original resource size on the UI

Open LuniMoon opened this issue 2 years ago • 3 comments

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

LuniMoon avatar Dec 21 '23 11:12 LuniMoon

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

image

Technical solution

  • Add a boolean property hasCustomSize which is set to false on new objects and default to true for compatibility
  • Use this property in
    • the scene editor
    • the instance editor
    • the runtime

D8H avatar Dec 21 '23 16:12 D8H

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

LuniMoon avatar Dec 22 '23 15:12 LuniMoon

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)

D8H avatar Dec 22 '23 15:12 D8H