4

I have MonoTouch controller, where I launch my MonoGame game. So I'm leaving my UI and entering the game like so:

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

I'm having problem with ending the game and going back to my XCode UI in MonoTouch Controller.

I've tried

this.Exit();

and

this.Dispose();

But none of them seem to do the trick. Does anyone know how I can abort the game, but still stay in MonoTouch world?

Thanks.

Max
  • 211
  • 3
  • 7
  • I'm inclined to say you should try making your own game loop and call RunOneFrame instead of Run, but after looking at the implementation on github I'm not so sure it will work. https://github.com/mono/MonoGame/blob/develop/MonoGame.Framework/Game.cs – craftworkgames Jun 03 '13 at 06:04
  • Are you having this issue with the MonoGame (XMAL) template or just the non-xmal template? I had this same issue with the XMAL template and I had to switch it to make this work. – kwelch Oct 23 '14 at 03:40

1 Answers1

0

Have you made any progress on this?

The other technique that might work is to close the game from within MonoTouch:

game.Exit();

As a simple test, you could make a timer in MonoTouch that does this after, e.g. 5 seconds. If this works, you would then need to find a way for MonoGame to communicate with MonoTouch to tell it when the game should be quit. It's not ideal, but if nothing else has worked, it might be your only option.

nosignal
  • 11
  • 3