Display Profile qualifiers not working?

Hello :slight_smile:

I was trying to see how Defold could handle different resolutions on different devices. But it seems that the engine picks only the top qualifier on the list?

I setup a simple test project to show this, here is the compressed file:
Mobile game.zip (414.4 KB)

I deployed and tested on an iPhone 14 and iPad Air 4.

On the iPhone the portrait/landscape layouts look like this:


On the iPad like this:


So from my point of view on the iPad the portrait layout is wrong and on the iPhone the landscape layout is wrong.

Any thoughts?

Thanks. I recreated the issue on GH: Display Profile qualifiers not working · Issue #9468 · defold/defold · GitHub

We review new issues every Monday and will take a look at it next time.

Thank you, looking forward to hear updates :slight_smile:

Hello there :slight_smile: any updates about this issue came out yesterday?

@AGulev is going to look into it for iOS

1 Like

When I check your project, I see in the editor exactly what you see on ipad/iphone.

To handle it right, you should work with a virtual coordinate space the editor suggests:

e.g.


1 Like

It seems there is a misunderstanding of how the system works.

You create multiple profiles, each representing a virtual coordinate space that is applied based on specific qualifiers. The first qualifier defines the virtual space size. The engine selects the closest qualifier according to Defold’s dynamic profile selection. Once the engine selects a profile, it applies all the overrides from the GUI file associated with that profile.

You can specify a separate profile for each screen size, but it’s not mandatory. The engine operates using a virtual profile space, which is then mapped onto the real space using the rules specified in the nodes. For example, if the selected profile includes a zoom on the background, it will adjust according to the screen size, etc.

So, in your example

You have one virtual coordinate space set to 1920x1080, and you design your interface according to this profile. This profile will be applied if one of its qualifiers fits better than all other available qualifiers. The engine picks the most suitable profile based on the defined qualifiers, ensuring that the interface is adjusted to match the best possible virtual space for the given screen size.

3 Likes

Thank you for the very detailed update :slight_smile: So if I understand correctly, defining the model device name (i.e iPad13,1) doesn’t really matter as the engine will pick the qualifier with lowest score from this formula:
image

So just for testing I setup 2 qualifiers for the landscape profile:

and deployed on the iPad air 4 (which has physical resolution 2360x1640) so the second qualifier on the list should be picked right? As it scores 0…
But I think it’s still picking the first qualifier (the 1280x720 one).

Btw, how can I get from code the current virtual resolution picked by the engine?

Each profile is tied to a single virtual resolution. You can specify as many qualifiers as needed, but all of them will use the resolution defined in that profile.

In your example, even if you have one or multiple qualifiers for Landscape, this profile will be selected based on your setup. When you have only two profiles, like Portrait and Landscape, there’s generally no need to have more than one qualifier per profile. However, if you want to have two distinct Landscape profiles, it’s likely that multiple qualifiers will be necessary to handle different cases.

If you want to create two distinct interfaces for resolutions such as 1280x720 and 2360x1640, you will need to create two separate profiles for those specific resolutions. Each profile will handle its own virtual space based on the screen size and the rules set in the qualifiers.

1 Like

Thank you! I’m starting to get my head around this now :slight_smile:

Is there a way to get the virtual resolution from code?

Another question related to this topic … what would be the best approach if I wanted my game to always in portrait orientation on phones, but in landscape on tablets?