差分
ナビゲーションに移動
検索に移動
編集の要約なし
たとえばGameクラス(MonoGameにおける[[エントリポイント]]に相当するクラス)で以下のように解像度の設定を行ったとする。
<source pre lang="csharp"> this.GraphicsDeviceManager.IsFullScreen = false; this.GraphicsDeviceManager.PreferredBackBufferWidth = 720 ; this.GraphicsDeviceManager.PreferredBackBufferHeight = 1232 ; this.GraphicsDeviceManager.ApplyChanges();</sourcepre>
これがWindowsやMacで実行した場合は余程のことが無い限り要望した解像度になるだろう。
しかしAndroidなどでは異なる解像度が設定されることがある(詳細は「[[MonoGameで解像度を設定する]]」を参照)。
実際の解像度は以下のプロパティで取得できる。
<source pre lang="csharp"> this.GraphicsDevice.PresentationParameters.BackBufferWidth; this.GraphicsDevice.PresentationParameters.BackBufferHeight;</sourcepre>
== 注意点 ==