「MonoGame (Xamarin.Android)で画面の向きを指定する」の版間の差分

imported>Administrator
ページの作成:「 MonoGame (Xamarin.Android)プロジェクトを新規作成すると必ずエントリポイントとなるActivityクラスが作られる。 このActivityクラス...」
 
編集の要約なし
 
(同じ利用者による、間の1版が非表示)
4行目: 4行目:
このActivityクラスの「ScreenOrientation属性」を変更する。
このActivityクラスの「ScreenOrientation属性」を変更する。
基本的には至って普通のXamarin.Androidでの方法と同じである。
基本的には至って普通のXamarin.Androidでの方法と同じである。
* 初期値は「ScreenOrientation.FullUser」となっておりスマホの回転にあわせグルグル回る。
* 初期値は「ScreenOrientation.FullUser」となっておりスマホの回転にあわせグルグル回る。
* 横画面に固定したい場合は「ScreenOrientation.Landscape」を指定する。
* 横画面に固定したい場合は「ScreenOrientation.Landscape」を指定する。
* 縦画面に固定したい場合は「ScreenOrientation.Portrait」を指定する。
* 縦画面に固定したい場合は「ScreenOrientation.Portrait」を指定する。
<source>
 
    [Activity(Label = "Game1",
<source lang="csharp">
              MainLauncher = true,
[Activity(Label = "Game1",
              Icon = "@drawable/icon",
            MainLauncher = true,
              Theme = "@style/Theme.Splash",
            Icon = "@drawable/icon",
              AlwaysRetainTaskState = true,
            Theme = "@style/Theme.Splash",
              LaunchMode = LaunchMode.SingleInstance,
            AlwaysRetainTaskState = true,
              ScreenOrientation = ScreenOrientation.Portrait,
            LaunchMode = LaunchMode.SingleInstance,
              ConfigurationChanges = ConfigChanges.Orientation |
            ScreenOrientation = ScreenOrientation.Portrait,
                                      ConfigChanges.KeyboardHidden |
            ConfigurationChanges = ConfigChanges.Orientation |
                                      ConfigChanges.Keyboard |
                                    ConfigChanges.KeyboardHidden |
                                      ConfigChanges.ScreenSize)]
                                    ConfigChanges.Keyboard |
    public class GameActivity : AndroidGameActivity
                                    ConfigChanges.ScreenSize)]
    {
public class GameActivity : AndroidGameActivity
    }
{
}
</source>
</source>


== 関連項目 ==
== 関連項目 ==
* [[Xamarin.Android/画面の向きを固定する]]
* [[Xamarin.Androidで画面の向きを固定する]]


[[category: MonoGame]]
[[category: MonoGame]]