Skip to content

Commit d8a9214

Browse files
committed
Win10 version with Viewbox
1 parent 4bc69e6 commit d8a9214

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

BasicUI_MonoGame/BasicUI_MonoGame_Windows10_UWP/GamePage.xaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
88
mc:Ignorable="d">
99

10-
<SwapChainPanel x:Name="swapChainPanel" />
10+
<Viewbox Stretch="Fill">
11+
<SwapChainPanel x:Name="swapChainPanel" />
12+
</Viewbox>
1113

1214
</Page>

BasicUI_MonoGame/BasicUI_MonoGame_Windows10_UWP/GamePage.xaml.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ public GamePage()
3131
// Create the game.
3232
var launchArguments = string.Empty;
3333
_game = MonoGame.Framework.XamlGame<Game1>.Create(launchArguments, Window.Current.CoreWindow, swapChainPanel);
34+
35+
swapChainPanel.Width = _game.GraphicsDevice.PresentationParameters.BackBufferWidth;
36+
swapChainPanel.Height = _game.GraphicsDevice.PresentationParameters.BackBufferHeight;
3437
}
3538
}
3639
}

0 commit comments

Comments
 (0)