Stretch aspects in 2D mobile games

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Pyr
:warning: Old Version Published before Godot 3 was released.

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!

:bust_in_silhouette: Reply From: RandomShaper

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.