Unexpected behavior of the Layouts/Display Profiles qualifier

I have 3 display profiles: ratio 1.77 (640x1136), ratio 1.71 (640x1100), ratio 2.16 (640x1382)

And I expected that with increasing width they will be selected in order of ratio, but no
get 2.16, 1.71 and 1.77
at a fixed screen height


Defold v1.2.165
MacOS

1 Like

Can you please also share the project?

I made a new project
to reproduce:

  1. build by command+B
  2. resize window width

Layout Test.zip (214.5 KB)

1 Like

This is not how the algorithm for picking the right layout works. The algorithm is described here:

Each time the screen is resized Defold will calculate how well your layouts match the actual screen size. Defold will use the layout that is the closest match.

2 Likes

Thanks for the quick response.
I rechecked by the formula from manual and all works right.
But it seems difficult to predict which layout will be chosen.
It would be cool to be able to choose the layout yourself.