[Solved] Inconsistent scaling behaviour

I have character sprite with resolution of 32x48 that weirdly scales in my game
In some scenes, everything is good, in others - one eye is bigger than another or arms are longer that they should be
Also, during one launch scaling is good, but when I relaunch GDevelop, scale may be broken
In every scene I use the same scene scale and resolution (1024x576)
For example, this is my character in fullscreen mode in one scene and it doesn’t look good (eyes are different, left half of the image)
image
And I have another scene with the same properties, but character looks fine there (right half of the image)
Is there any way to make scaling consistent?

Use rounded coordinates and the same multiple of the original image size as scale. This is happening because the renderer, in the end, needs to render a grid of pixels. If the pixels of your image do not overlap with the pixels of the renderer, either because you moved it to a non-integer position or scaled it to not a multiple of the original size, the renderer will have to arbitrarily decide whether a pixel counts as which color, which will vary depending on the non integer position or scale of the object:

I don’t multiply size of the character. Its’ sprite size is 32×48 and it has the same resolution in the scene
And also, round pixels option in project propreties is active, but it doesn’t change anything, I see no difference with and without this option
Anyway, thank you for your comprehensive answer

Is your game resolution a factor of modern monitor resolutions, and/or do you have an odd resolution display?

There were some laptops for a while that had 1366x768 resolution displays. They will not display scaling correctly from any game that uses normal scaling, as they do not share a divisor/denominator with modern displays (720p/1080p/1440p/2160p).

Likewise, if your game isn’t a common divisor/denominator/etc for modern displays, fullscreen scaling isn’t going to look right.

(E.g. If your game is 800x600, and you’re trying to display it on a 1080p display, no matter what it will not scale appropriately, as you cannot fit 800 into 1920 evenly (2.4x isn’t an integer, so like Arthuro’s image above, it has to make half-pixels), nor will 600 scale into 1080p evenly.)

1 Like

Yes! It was the problem! I changed game resolution to 960×540 and now it runs perfectly on my 1080p screen
Thank you very much

1 Like