Exit MonoGame and give control to MonoTouch

I have a MonoTouch controller where I launch my MonoGame game. Therefore, I leave my interface and enter the game like this:

Game game = new Game(); game.Run(); 

I am having problems ending the game and returning to my Xcode interface in MonoTouch Controller.

I tried

 this.Exit(); 

and

 this.Dispose(); 

But none of them seem to be doing this. Does anyone know how I can interrupt the game, but still remain in the world of MonoTouch?

Thanks.

+4
source share
1 answer

Have you had any progress on this issue?

Another way that might work is to close the game from MonoTouch:

 game.Exit(); 

As a simple test, you can make a timer in MonoTouch, which does it after, for example. 5 seconds. If this works, you will need to find a way for MonoGame to communicate with MonoTouch to let you know when the game should be stopped. This is not ideal, but if nothing worked, this might be your only option.

0
source

Source: https://habr.com/ru/post/1483877/


All Articles