「MonoGame (Xamarin.Android)で初期解像度がおかしい機種の対策」の版間の差分

編集の要約なし
編集の要約なし
3行目: 3行目:
そのような場合は初期化の際にGraphicsDevice.DisplayModeプロパティの値で明示的に解像度を設定すると改善する。
そのような場合は初期化の際にGraphicsDevice.DisplayModeプロパティの値で明示的に解像度を設定すると改善する。
<source lang="csharp">
<source lang="csharp">
        protected override void Initialize()
protected override void Initialize()
        {
{
            this.graphics.IsFullScreen = false;
    this.graphics.IsFullScreen = false;
            this.graphics.PreferredBackBufferWidth  = GraphicsDevice.DisplayMode.Width;
    this.graphics.PreferredBackBufferWidth  = GraphicsDevice.DisplayMode.Width;
            this.graphics.PreferredBackBufferHeight = GraphicsDevice.DisplayMode.Height;
    this.graphics.PreferredBackBufferHeight = GraphicsDevice.DisplayMode.Height;
            this.graphics.ApplyChanges();
    this.graphics.ApplyChanges();


            base.Initialize();
    base.Initialize();
        }
}
</source>
</source>