2

I'm just getting started with Xamarin and CocosSharp so it's possible I've missed something basic here.. but whatever it is I can't seem to figure it out.

I'm trying to get my app/game to be fullscreen (I would prefer to see the status bar with connection, battery, and time.. but for now I'll settle for just full screen.

I'm editing this line:

CCScene.SetDefaultDesignResolution(1080, 1920, CCSceneResolutionPolicy.ShowAll);

And I've tried a bunch of different resolutions, but no matter what I do I can't get it to use the entire screen. As you can see in the image below, even if I enter a very large value for the height, it still does not use up all the free space.

How do I make it so the game uses the entire screen, and if possible shows the status bar?

If it makes any difference the program is set to portrait only.

enter image description here

This is the entire code where I try to set the resolution & aspect ratio.

application.ContentRootDirectory = "Content";
var windowSize = mainWindow.WindowSizeInPixels;

CCScene.SetDefaultDesignResolution(1080, 1000, CCSceneResolutionPolicy.ShowAll);
application.ContentSearchPaths.Add("hd");
CCSprite.DefaultTexelToContentSizeRatio = 2.0f;

var scene = new CCScene(mainWindow);
var introLayer = new IntroLayer();
scene.AddChild(introLayer);

mainWindow.RunWithScene(scene);

Update 1: Changed the code to use .ExactFit, did not make much of a difference.

Tried these two lines, the result is the image below. Not the difference in the text, there are more pixels in the right one, but they are compressed.. and still the black border.

CCScene.SetDefaultDesignResolution(1080, 1920, CCSceneResolutionPolicy.ExactFit);
CCScene.SetDefaultDesignResolution(1080, 2500, CCSceneResolutionPolicy.ExactFit);

enter image description here

JensB
  • 6,663
  • 2
  • 55
  • 94

2 Answers2

0

I know the question is old, but in case somebody would still find it useful:

Make sure you have added the launch screens (storyboard or images). I know - who would have thought not adding a launch screen would create the black bars, but this is exactly what fixed the issue for me.

More info how I got to this solution is available here: https://forums.xamarin.com/discussion/19917/ios-app-not-displaying-in-full-screen

JohnV
  • 981
  • 2
  • 8
  • 18
-1
CCScene.SetDefaultDesignResolution(1080, 1000, CCSceneResolutionPolicy.ExactFit);
jaybers
  • 1,991
  • 13
  • 18