MainActivity.cs 651 B

123456789101112131415161718
  1. using Android.App;
  2. using Android.OS;
  3. using Microsoft.Xna.Framework;
  4. namespace Tetris.Android
  5. {
  6. [Activity(Label = "Tetris", MainLauncher = true, Icon = "@mipmap/icon", Theme = "@style/MainTheme", ConfigurationChanges = Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
  7. public class MainActivity : AndroidGameActivity
  8. {
  9. protected override void OnCreate(Bundle savedInstanceState)
  10. {
  11. base.OnCreate(savedInstanceState);
  12. var g = new TetrisGame();
  13. SetContentView((g.Services.GetService(typeof(View))) as View);
  14. g.Run();
  15. }
  16. }
  17. }