I have implemented to my game a simple leaderboard and submit score pages, which are pages in XAML. I used PreferredBackBufferHeight/Width to set the buffer to be equaly on all devices, whether their screen size is 5 inch, 4.7 or whatever size. Though I thought the problem was solved, now, when I was testing my game on emulator for bigger devices, I encountered a problem when returning back to game page from the xaml page. Let me show you some pics, and you will understand what I am talking about:
Testing on Emulator 4.7 inch:
1) Before entering the leaderboard xaml page (everything normal):
2) After exiting from xaml leaderboard page:
Even if I tried to put the PreferredBackBufferHeight/Width in the function that I call to exit from the leaderboard page, it didn't change anything... :
private void NavigateBackToMain()
{
var app = App.Current as App;
if (app.GamePage == null) app.GamePage = new GamePage(string.Empty);
Game1.statics.graphics.SupportedOrientations = Microsoft.Xna.Framework.DisplayOrientation.LandscapeRight | Microsoft.Xna.Framework.DisplayOrientation.LandscapeLeft;
Game1.statics.graphics.PreferredBackBufferHeight = Constants.PrefferedBufferHeight;
Game1.statics.graphics.PreferredBackBufferWidth = Constants.PrefferedBufferWidth;
Window.Current.Content = app.GamePage;
}
What can I do about my problem?