+1 vote

Hi everyone,
I'm working on a 2D mobile game and I have a really hard time understanding the stretch aspect options.

Given a 2D stretch mode, how are not matching aspect ratios handled?
This is what I grasped:

  • Ignore: scales the original resolution to fit the device's resolution. If the original aspect ratio is different, it is stretched to match the new one -> causes distortion, no cropping, no black bars.
  • Keep: scales the original resolution to fit the device's resolution. If the original aspect ratio is different, black bars are added -> no distortion, no cropping.
  • Keep width: scales the original resolution to fit the device's width.
    case 1) if the height, scaled proportionally, is shorter than the device's screen, it is made fit by rendering new content (for example a background image) -> no distortion, greater xFov
    case2) if the height, scaled proportionally, is taller than the device's screen -> ??? exceding height is cropped?
  • Keep height: scales the original resolution to fit the device's height.
    case 1) if the width, scaled proportionally, is shorter than the device's screen, it is made fit by rendering new content (for example the rest of the level) -> no distortion, greater yFov
    case2) if the width, scaled proportionally, is taller than the device's screen -> ??? exceding height is cropped?

Am I correct? Can someone help me figure this out please?

Thanks a lot in advance!

in Engine by (21 points)

1 Answer

+1 vote
Best answer

Yes, excess width/height will be cropped according to the 'Keep' mode chosen.

Plain 'Keep' is the safest, but if you consider a safe rect that will fit any relevant screen ratio (16:9 being the most common case), you can crop safely.

by (182 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.