Skip to content

Integer scaling settings option for pixel art and different aspect ratios. #7495

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
GDDEGabriel opened this issue Mar 23, 2025 · 7 comments

Comments

@GDDEGabriel
Copy link

Description

The problem is with the resolution scaling, basically, most engines will have multiple types of scaling:
some engines default to either a "stretch mode" which just stretches the game view to fit the window.

Others will have a "letterbox scaling" which Gdevelop does provide, which will scale the game view up until one of the sides hits a border, in which case, the other side will have a letterbox to fit window.
this is all good, but there is a problem with this method, since the aspect ratio of the game might not match the monitor's aspect ratio, this can cause quite a lot of distortion due to fractional values in the scaling.

Most engines also have a "integer letterbox scaling" that does the same thing as the default letterboxing, but floors the scaling value to the nearest integer, which makes said distortions disappear.
GDevelop does allow you to code one yourself, but most engines of the same mold ( beginner friendly, "no-code", etc... ) will have this feature by default ( except Fusion 2.5, forget that one... ).

Solution suggested

Add a "integer letterbox scaling" mode to the game settings.

Showcase of all scaling modes described above :

"Stretch" mode :

Image

"Letterbox" mode :

Image

"Integer Letterbox" mode :

Image

I could probably do it myself, but i would need to familiarize myself with the engine's codebase, that probably won't take long and is something i would like to do eventually, but i am currently out of time... lots of stuff in life...

Alternatives considered

I don't think there are any alternatives, it's quite a simple feature request... i don't think it needs one.

Screenshot of the events used to add Integer Letterbox in GDevelop :

Image

Project file used for the screenshots :

resolutionTest.zip

Final comments :

Apologies in advance if anything feels poorly worded, This is my first time opening an issue on github and all i want is this engine to succed, it is quite a good piece of software, coming from fusion 2.5, this is such a better experience!

@Bouh
Copy link
Collaborator

Bouh commented Mar 26, 2025

These modes are quite common and missing.
I suggest another one, I don't know if there is a name. Let's say WithoutLetterbox?

The idea is to enlarge the game zone until there's no black bar at all. But on the other hand, the game could be cut off at the top and bottom as in the image bellow, or on the sides.

Image

@Silver-Streak
Copy link
Collaborator

The idea is to enlarge the game zone until there's no black bar at all. But on the other hand, the game could be cut off at the top and bottom as in the image bellow, or on the sides.

I think the current "Extend or Crop" modes added last year would account for these, correct?

@GDDEGabriel
Copy link
Author

GDDEGabriel commented Mar 26, 2025

The idea is to enlarge the game zone until there's no black bar at all. But on the other hand, the game could be cut off at the top and bottom as in the image bellow, or on the sides.

I think the current "Extend or Crop" modes added last year would account for these, correct?

I never used these so i wouldn't know... I didn't mention these because i was unsure if that was the case.
I'll test these when i have the time.

@Silver-Streak
Copy link
Collaborator

I never used these so i wouldn't know... I didn't mention these because i was unsure if that was the case.
I'll test these when i have the time

Sorry, was explicitly replying to Bouh's comment, not your overarching ask.

I actually think a lot of your ask may be accounted for by this PR from Davy, though: #7494

@GDDEGabriel
Copy link
Author

GDDEGabriel commented Mar 26, 2025

I never used these so i wouldn't know... I didn't mention these because i was unsure if that was the case.
I'll test these when i have the time

Sorry, was explicitly replying to Bouh's comment, not your overarching ask.

I actually think a lot of your ask may be accounted for by this PR from Davy, though: #7494

Not really, in fact, that PR was exactly the reason i made this issue, it solves the same issue in a different way.
besides, the letterboxing approach works better for games with low resolutions, where every distortion is clearly visible.

I was just answering your answer, it didn't really have anything to do with my comment, but i was interested is all.
No worries.

@jayare5
Copy link

jayare5 commented Apr 17, 2025

I had made a similar post some years ago :D
Sadly, it lead nowhere, but here it is:

#5910 (comment)

@GDDEGabriel
Copy link
Author

I had made a similar post some years ago :D Sadly, it lead nowhere, but here it is:

#5910 (comment)

Honestly, that's a shame... yours even has another type of scaling!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants