*
* @param viewController The view controller.
* @return Or real display dimension. */
CGSize getBounds (UIViewController viewController) {
// or screen size (always portrait)
CGSize bounds = UIScreen.getMainScreen().getBounds().size();
// determine orientation and resulting width + height
UIInterfaceOrientation orientation = viewController != null
? viewController.getInterfaceOrientation() : uiApp.getStatusBarOrientation();
int width;
int height;
switch (orientation) {
case LandscapeLeft:
case LandscapeRight:
height = (int)bounds.width();
width = (int)bounds.height();
break;
default:
// assume portrait
width = (int)bounds.width();
height = (int)bounds.height();
}
// update width/height depending on display scaling selected
width *= displayScaleFactor;
height *= displayScaleFactor;
// log screen dimensions
Gdx.app.debug("IOSApplication", "View: " + orientation.toString() + " " + width + "x" + height);
// return resulting view size (based on orientation)
return new CGSize(width, height);
}