Skip to content

Add a scale mode for modern pixel-art games #7494

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

D8H
Copy link
Collaborator

@D8H D8H commented Mar 23, 2025

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

@Silver-Streak
Copy link
Collaborator

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

@D8H D8H marked this pull request as ready for review March 28, 2025 16:37
@D8H D8H requested a review from 4ian as a code owner March 28, 2025 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants