I am trying to create a small game for Android using Monogame. I am having issues setting up the Immersive mode. I dd everything as it is suposed to be, but it is still not covering the whole screen.
I read somewhere that this is a problem monogame has, but I have not been able to find any solution on the Internet at all. I am using a Samsung Galaxy S22 Ultra as my testing device.
Everything seems to be fine, the immersive mode is indeed activated because it hides the navigation bar and so, but it is still not covering the whole screen when I print everything.
Is there any other work around or permanent solution for this?
I had to add this code recently for the camera cutoff.
Fullscreen in android is messy. There are 3 or 4 (or 5 ā¦?) Diferent apis and properties that control the keyboard/status bar/viewsize and everything in between.
if (Android.OS.Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.P)
{
// Enable drawing over the camera cutoff.
Window.Attributes.LayoutInDisplayCutoutMode |= Android.Views.LayoutInDisplayCutoutMode.ShortEdges;
}
Call this in OnCreate().
We still donāt know if that is your issue.
A screenshot will be helpful.
Also, this image can explain my problem a little bit. You see how the image is printed on the screen but it doe snot cover the whole screen? That is exactly my issue.
For some reason, there is a region of the screen that just shows the default color you using with GraphicsDevice.Clear();
Even if Iprint a imagen on the 0,0 coordinates, it would not print at the exact 0,0 of the screen.
It a reimplementation of Xna API. Some of the things that MonoGame added might have been change or removed. The changelog has details on all the changes.
Thank you very much nkast. Youāre awesome and you have my respect. For the life of me I could not find Window.Attributes.LayoutInDisplayCutoutMode |= Android.Views.LayoutInDisplayCutoutMode.ShortEdges; anywhere. Google ended up leading me here of all places even though my current game isnāt using the MG framework. Thank youi.