MainActivity.cs 1005 B

123456789101112131415161718192021222324252627
  1. using Android.App;
  2. using Android.Content.PM;
  3. using Android.OS;
  4. using Android.Views;
  5. using Microsoft.Xna.Framework;
  6. namespace RectangleCollision.Android
  7. {
  8. [Activity(
  9. Label = "RectangleCollisionSample",
  10. MainLauncher = true,
  11. Icon = "@mipmap/icon",
  12. Theme = "@android:style/Theme.NoTitleBar",
  13. ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.Navigation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize,
  14. ScreenOrientation = ScreenOrientation.SensorLandscape
  15. )]
  16. public class MainActivity : AndroidGameActivity
  17. {
  18. protected override void OnCreate(Bundle savedInstanceState)
  19. {
  20. base.OnCreate(savedInstanceState);
  21. var game = new RectangleCollisionGame();
  22. SetContentView((game.Services.GetService(typeof(View)) as View));
  23. game.Run();
  24. }
  25. }
  26. }