GDevelop icon indicating copy to clipboard operation
GDevelop copied to clipboard

Add a scale mode for modern pixel-art games

Open D8H opened this issue 9 months ago • 1 comments

Issue

Pixel-art creators often wonder:

  • Why is the movement jerky?
  • Why is my sprites deformed when the camera moves? (referring to nearest neighbors making some pixel column and row a bit bigger or smaller)
  • Why is my text blurry?

Workaround issues

Creators are often suggested to multiply their game resolution and either:

  • Upscale their resources
    • This need a lot of manual changes
    • It only reduces the issue but artifacts are still there
  • Zoom all layers
    • UI layers are no longer positioned correctly
    • The editor camera rectangle is no longer a useful
    • Changing all layer zoom is cumbersom
    • Events have to take into account the default zoom is no longer 1

Solution

  • Add a "Magnified" scale mode that zooms games by the best integer value and do linear scaling for the decimal part.
  • This is transparent for creators, from events: default zoom is still 1, the camera size is same as usual and window size too.
  • The objects are rendered exactly like the "zoom all layers" workaround. It means that the rendered canvas is actually bigger which allow:
    • "vector" graphics (shape painter, light, particles, text) to be rendered in hi-res
    • sprites are transformed in hi-res
  • Same as for "nearest neighbor" scale mode, the resources property "Smooth" needs to be unchecked.

image

image

D8H avatar Mar 23 '25 17:03 D8H

Based off the age of my forum thread, I've been asking for this since 2020. Super excited to see this progress.

Silver-Streak avatar Mar 24 '25 04:03 Silver-Streak