- Home /
How to show Game Center dialog on Mac in Capture Display mode
My Mac app has just been rejected by Apple because the Game Center login dialog stayed hidden behind the actual app that was running in Capture Display Mode.
Now, "Capture Display" seems to be the only MacFullScreenMode that allows rendering in Retina resolution on MacBook Pro - and Apple wants developers to support the Retina resolution.
But in that mode, the app does not automatically disappear to show the Game Center log-in dialog (which only happens in the other fullscreen modes with the pixelated virtual desktop resolution). The Game Center dialog just stays behind the fullscreen app and the authentication can't proceed.
Can the app somehow get a notification that the login dialog has appeared (and thus switch to window mode)? Or is there any workaround?
Cause if not, it's basically impossible to create a Mac app with Unity that supports Retina resolution and Game Center.
Thank you, Thomas
Answer by Gamesmold · Nov 26, 2013 at 09:19 AM
OK, to solve this issue, you just have to listen for an OnApplicationPause event. This event will be triggered when the Game Center dialog opens (using the Prime31 plugin, as it is Game Center on Mac). Then simply let this event switch your app to window mode (if it was in fullscreen mode) and the dialog window becomes visible. As Game Center communication will always occur at the start of your app (and thus bring the possibility of a login window opening up), it also makes sense to always start your app in window mode, waiting till Game Center communication is done, and then going to fullscreen (if the user wants fullscreen - you can use PlayerPrefs to remember if the app had been run in fullscreen the last time). To make sure the app always starts in window mode before entering fullscreen, you can use PlayerPrefs.SetInt("Screenmanager Is Fullscreen mode", 0). Same with the preferred resolution, it's also stored there ("Screenmanager Resolution Width", "Screenmanager Resolution Height"). Feels like a hack, but works fine.
Always keep in mind, all this is only to achieve Retina resolution in CaptureDisplay mode.
Now, for the bad news - I did these changes to my app and it got rejected a second time because the mouse cursor did not map correctly to the UI in fullscreen mode. This is also an issue that only occurs in CaptureDisplay mode. On Retina MacBook Pro I solved it by using a Software Cursor (if Screen.height>=1600...), but this happened on an iMac (where I thought that there would be no cursor/resolution issues).
EDIT:
Just a quick update that now, after two rejections, the app has finally been approved! And I managed not to drop Retina support, though there were plenty of new issues to solve. For instance, as you have to use a software mouse cursor in capture display mode, the framerate must not drop to a too low speed. Otherwise your cursor will also begin to stutter badly.
Also, I could not find a single Unity app on the Mac App Store that does support Retina resolution. So I guess this might really be an interesting topic... I think I'll start a forum thread explaining my best practice experiences for making a Retina-enabled Mac app - which is, at the moment, definitely very, very difficult. For the cursor bugs, I've reported them to Unity, so here's hoping they will be fixed with a future update.