「MonoGame (Xamarin.Android)で初期解像度がおかしい機種の対策」の版間の差分
Administrator (トーク | 投稿記録) 編集の要約なし |
Administrator (トーク | 投稿記録) 編集の要約なし |
||
| 3行目: | 3行目: | ||
そのような場合は初期化の際にGraphicsDevice.DisplayModeプロパティの値で明示的に解像度を設定すると改善する。 | そのような場合は初期化の際にGraphicsDevice.DisplayModeプロパティの値で明示的に解像度を設定すると改善する。 | ||
<source lang="csharp"> | <source lang="csharp"> | ||
protected override void Initialize() | |||
{ | |||
this.graphics.IsFullScreen = false; | |||
this.graphics.PreferredBackBufferWidth = GraphicsDevice.DisplayMode.Width; | |||
this.graphics.PreferredBackBufferHeight = GraphicsDevice.DisplayMode.Height; | |||
this.graphics.ApplyChanges(); | |||
base.Initialize(); | |||
} | |||
</source> | </source> | ||