Default viewport size and position?

When my game runs on the 3.5-inch iOS simulator, the default viewport size is 960 x 640. That is correct. However, when it runs on the 4-inch simulator which has a resolution of 1136 x 640, the default viewport size is still 960 x 640 and the game gets centered on the screen, leaving black stripes on the sides… Anyone knows what the problem is?

What values are you checking to see the Viewport size? All of these seem to be set to the correct values by default for me:

graphics.PreferredBackBufferWidth
graphics.PreferredBackBufferHeight
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height
GraphicsDevice.Viewport.Width
GraphicsDevice.Viewport.Height

Tested and confirmed in these iOS Simulators: iPhone (3.5"), iPhone Retina (3.5"), iPhone Retina (4"), iPad, and iPad Retina.

Have you included a 4-inch loading image in your build? If not it will assume you don’t support that size and just run as a 960*640 app.

@picobots I was using GraphicsDevice.Viewport.Width and Height
@BitBull Thanks man! I didn’t include a 4-inch loading image and that should be the reason. I’ll test it out later today!

I just had to stop by and say thanks to @BitBull because I just scrambled around for half a day assuming it was yet another issue with MonoGame, wondering why the screen had black bars around it, even though my code was made to support any screen size…

Adding the loading images in the .plist makes the screen display properly. If you were my neighbor I would bake you some brownies.

If you were my neighbour I’d happily eat them!

You’re welcome.

I’m having a similar issue at the moment, I can’t get the viewport to be full sized within the simulator. I’ve added the image as you described but it never gets shown.

I never get to see the launch image however as it appears that because I’m using Xamarin in a trial mode it gets removed and replaced with a trial image launch screen.

Do you think this would affect the viewport for me? I’m left with a massive black border at the bottom.

Further :

I’ve paid for a full license, now splash screens are showing as expected however, I can’t get rid of what I would call the scaling issue. Sorry for all the questions very new to this and found many hurdles so far.

Edit :smile:

Cracked it, this was down to a bug with IOS 8 and viewport sizes. I’ve compiled the latest source and now it’s working correctly.