2019-09-01 11:56:12 +02:00
|
|
|
using Android.App;
|
|
|
|
using Android.Content.PM;
|
|
|
|
using Android.OS;
|
|
|
|
using Android.Views;
|
2020-02-01 20:50:42 +01:00
|
|
|
using MLEM.Input;
|
2019-09-01 11:56:12 +02:00
|
|
|
|
2019-12-05 22:09:11 +01:00
|
|
|
namespace Demos.Android {
|
2019-09-01 11:56:12 +02:00
|
|
|
[Activity(Label = "Demos.Android"
|
|
|
|
, MainLauncher = true
|
|
|
|
, Icon = "@drawable/icon"
|
|
|
|
, AlwaysRetainTaskState = true
|
|
|
|
, LaunchMode = LaunchMode.SingleInstance
|
2020-02-01 20:50:42 +01:00
|
|
|
, ScreenOrientation = ScreenOrientation.FullUser
|
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);
|
|
|
|
var g = new GameImpl();
|
2020-02-01 20:50:42 +01:00
|
|
|
g.OnLoadContent += game => {
|
|
|
|
// disable mouse handling for android to make emulator behavior more coherent
|
|
|
|
game.InputHandler.HandleMouse = false;
|
|
|
|
// enable android text input style
|
|
|
|
game.InputHandler.TextInputStyle = new TextInputStyle.Mobile();
|
|
|
|
};
|
2019-09-01 11:56:12 +02:00
|
|
|
this.SetContentView((View) g.Services.GetService(typeof(View)));
|
|
|
|
g.Run();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|