MainActivity.cs 918 B

12345678910111213141516171819202122232425262728293031323334
  1. #if ANDROID
  2. using Android.App;
  3. using Android.Content.PM;
  4. using Android.OS;
  5. using Android.Views;
  6. using Microsoft.Xna.Framework;
  7. namespace GooCursor
  8. {
  9. [Activity(
  10. Label = "GooCursor",
  11. MainLauncher = true,
  12. AlwaysRetainTaskState = true,
  13. LaunchMode = LaunchMode.SingleInstance,
  14. ScreenOrientation = ScreenOrientation.FullUser,
  15. ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.ScreenSize)]
  16. public class MainActivity : AndroidGameActivity
  17. {
  18. private Game1 game;
  19. private View gameView;
  20. protected override void OnCreate(Bundle bundle)
  21. {
  22. base.OnCreate(bundle);
  23. game = new Game1();
  24. gameView = game.Services.GetService(typeof(View)) as View;
  25. SetContentView(gameView);
  26. game.Run();
  27. }
  28. }
  29. }
  30. #endif