Skip to content
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

Add new dimension option: 'scale-up-proportional' #93

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ejb
Copy link
Contributor

@ejb ejb commented Jul 12, 2021

This adds a third option for scaling up that preserves pixel ratios. Essentially, the game canvas is scaled the highest possible integer. It's a great option for retro-style pixel art.

For example, here's scaled-up. Note how some of the pixels on the birb are wider than others, leading to distortion of the sprite.

scaled-up

And the same scene with scaled-up-proportional. The borders are annoying, but a reasonable compromise to preserve the art style.

scaled-up-proportional

@edbentley
Copy link
Owner

I don't quite understand why some pixels are wider. Shouldn't you just have a greater width / height margin with a fixed size image?

And what's the difference with this option and just setting margins to 0?

    maxWidthMargin: 0,
    maxHeightMargin: 0,

Also please rebase with the latest master.

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