示例#1
0
        /// <summary>
        /// Create MonoGame instance and set the content view.
        /// </summary>
        /// <param name="bundle"></param>
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            var requiredPermissions = new String[] {
                Manifest.Permission.ReadExternalStorage,
                Manifest.Permission.WriteExternalStorage,
                Manifest.Permission.Camera
            };

            ActivityCompat.RequestPermissions(this, requiredPermissions, 123);

            InputMethodManager inputMethodManager = GetSystemService(InputMethodService) as InputMethodManager;

            androidFunctions = new AndroidFunctions(inputMethodManager, this);

            JCIW.App.MainApp main = new JCIW.App.MainApp(new AndroidNetwork(), androidFunctions, Platform.Android);

            game = (Game)main.Window();

            view = game.Services.GetService(typeof(View)) as View;
            androidFunctions.View = view;

            SetContentView(view);

            game.Run();
        }
示例#2
0
        /// <summary>
        /// Create MonoGame instance and set the content view.
        /// </summary>
        /// <param name="bundle"></param>
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            var requiredPermissions = new String[] {
                Manifest.Permission.ReadExternalStorage,
                Manifest.Permission.WriteExternalStorage
            };

            ActivityCompat.RequestPermissions(this, requiredPermissions, 123);

            InputMethodManager inputMethodManager = GetSystemService(InputMethodService) as InputMethodManager;

            androidFunctions = new AndroidFunctions(inputMethodManager, this);

            game = new GraphicsEngine.GUIWindow(GraphicsEngine.Platform.Android, androidFunctions);

            view = game.Services.GetService(typeof(View)) as View;
            androidFunctions.View = view;

            SetContentView(view);

            game.Run();
        }