MainActivity.cs 764 B

1234567891011121314151617181920
  1. // Entry point for Android platform
  2. using Android.App;
  3. using Android.OS;
  4. using Android.Content.PM;
  5. using Microsoft.Xna.Framework;
  6. namespace StarWarrior.Android
  7. {
  8. [Activity(Label = "StarWarrior", MainLauncher = true, Icon = "@mipmap/ic_launcher", Theme = "@android:style/Theme.NoTitleBar", ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.KeyboardHidden | ConfigChanges.ScreenSize, ScreenOrientation = ScreenOrientation.Landscape)]
  9. public class MainActivity : AndroidGameActivity
  10. {
  11. protected override void OnCreate(Bundle bundle)
  12. {
  13. base.OnCreate(bundle);
  14. var g = new StarWarriorGame();
  15. SetContentView((View)g.Services.GetService(typeof(View)));
  16. g.Run();
  17. }
  18. }
  19. }