Display original resource size on the UI
Is there an existing issue for this?
- [X] I have searched the existing issues
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
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:
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
We should probably add a checkbox like in the instance editor (unchecked by default).
Technical solution
- Add a boolean property
hasCustomSizewhich is set tofalseon new objects and default totruefor compatibility - Use this property in
- the scene editor
- the instance editor
- the runtime
Why do you suggest a checkbox instead of always giving the file resource size?
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)