|
@@ -121,6 +121,13 @@ void Platform::setWindowTitle(const char *title)
|
|
|
//------------------------------------------------------------------------------
|
|
|
void Platform::init()
|
|
|
{
|
|
|
+ // Create two variables that I use later to make the canvas the right size
|
|
|
+ CGRect screenBounds = [[UIScreen mainScreen] bounds];
|
|
|
+ CGFloat screenScale = [[UIScreen mainScreen] scale];
|
|
|
+
|
|
|
+ Con::setFloatVariable("$iOSwidth", screenBounds.size.width * screenScale);
|
|
|
+ Con::setFloatVariable("$iOSheight", screenBounds.size.height * screenScale);
|
|
|
+
|
|
|
Con::setVariable("$platform", "iOS");
|
|
|
|
|
|
if ([[UIScreen mainScreen] scale] == 2)
|
|
@@ -444,4 +451,4 @@ ConsoleFunction(setStatusBarHidden, bool, 2, 2, " Hides/unhides the iOS status b
|
|
|
|
|
|
ConsoleFunction(setStatusBarType, void, 2, 2, " Set the status bar type. 0 hidden, 1 Black Opaque, 2 Black Translucent \n"){
|
|
|
return setStatusBarType(dAtoi(argv[1]));
|
|
|
-}
|
|
|
+}
|