Is it possible to delete default mode for layout? (solved)

I originally setup everything on my UI in default. Then I learned how to add portrait and landscape mode. But now when I start my game it always starts on default until I rotate my phone. Is it possible to delete default mode? Or force the game to use portrait or lanscape modes (portrait and landscape is what I named the two modes).

Oh btw: I really do prefer the way defold handles UI vs. Unity. Unity was a convoluted mess.
image

Turn off the Dynamic Orientation in game.project -> Display.

If you mean to delete/modify the default.display_profiles file, then no since it’s a builtin file. That’s why you should create your own .display_profiles and put its path in game.project -> Display -> Display Profiles.

To put it simply, ensure that the Height is greater than the Width in game.project -> Display if you wish to use portrait mode, and vice versa for landscape mode.
Check this out for details on how it really works:

1 Like

What I mean is that I have two modes only portrait and landscape. I have it set to working dynamically, but when the game loads it loads the default profile. then after I rotate my screen it starts working like I intended. As you can see I have my profiles set up to be used, but it still launches with the default profile (at least when I’m testing on android device).

The issue is if you have your phone in portrait mode it loads as if it’s landscape (because it is using default profile which is landscape dimensions). So the game is zoomed way out to fit all the objects on screen. I have to rotate back and forth to get the portrait mode to load. :And I confirmed this is on the windows runtime as well… I just don’t notice it as it is landscape screen format.
image

How did you know that? Your setup looks fine to me and the game should be using your own .display_profiles. Also, The default.display_profiles file wouldn’t even exist in the game if it is not used or referenced by you. Check out the report.html file you get after bundling to confirm.

Do you mean that the game starts in landscape orientation or it just takes the dimensions of landscape mode and use them in portrait orientation?

Yes it zooms way out to fit the landscape into portrait mode.

Further testing and playing with the default resolution I think i’m starting to see what is going on. It appears to be doing some initial calculations based on the display size settings. So I need to play with that a bit more.

I’m not clear on what the best width & height is to set on the game. What does having a bigger or smaller size setting do? I see it impacts the zoom on the camera. What is the ideal size for a mobile game as there are so many different screen sizes.

I think I figured it out. Not sure how or why but after playing with the default display resolutions it now appears to be working. I’ll take it as a win.

1 Like