1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-04 22:49:08 +01:00
MLEM/Demos.Android/Activity1.cs

29 lines
1.1 KiB
C#
Raw Normal View History

2019-09-01 11:56:12 +02:00
using Android.App;
using Android.Content.PM;
using Android.OS;
using Android.Views;
2020-02-24 14:03:53 +01:00
using MLEM.Misc;
2019-09-01 11:56:12 +02:00
namespace Demos.Android {
2019-09-01 11:56:12 +02:00
[Activity(Label = "Demos.Android"
, MainLauncher = true
, Icon = "@drawable/icon"
, Theme = "@style/Theme.Splash"
2019-09-01 11:56:12 +02:00
, AlwaysRetainTaskState = true
, LaunchMode = LaunchMode.SingleInstance
, ScreenOrientation = ScreenOrientation.UserLandscape
2019-09-01 11:56:12 +02:00
, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.ScreenSize)]
public class Activity1 : Microsoft.Xna.Framework.AndroidGameActivity {
protected override void OnCreate(Bundle bundle) {
base.OnCreate(bundle);
2020-02-24 14:03:53 +01:00
TextInputWrapper.Current = new TextInputWrapper.Mobile();
2019-09-01 11:56:12 +02:00
var g = new GameImpl();
// disable mouse handling for android to make emulator behavior more coherent
g.OnLoadContent += game => game.InputHandler.HandleMouse = false;
2019-09-01 11:56:12 +02:00
this.SetContentView((View) g.Services.GetService(typeof(View)));
g.Run();
}
}
}