Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upLibGDX doesn't scale properly on iPhone 6+ or iPhone 6 in zoomed mode #2356
Comments
|
Bumping this, since this is one of the critical issues that needs to be prioritized. |
|
The team is aware of this issue and we are working on a solution. |
|
Going to reference #2350 as these are very related. |
|
Make sure you check zoomed mode. There is a nativeScale method on UIScreen in 8 that returns a non-integer value in zoomed mode. You'll need to use it instead of scale on 8. Paul Franceus, paul@blueiris.us
|
|
I'm currently busy figuring out RoboVM issues on iOS 8. Once we have that
|
|
Hi
switch (orientation) {
case LandscapeLeft:
case LandscapeRight:
height = (int)bounds.width();
width = (int)bounds.height();
if(width < height){ // workaround
width = (int) bounds.width(); // workaround
height = (int) bounds.height(); // workaround
} // workaround
break;
default:
// assume portrait
width = (int)bounds.width();
height = (int)bounds.height();
}
<key>UILaunchImages</key>
<array>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>8.0</string>
<key>UILaunchImageName</key>
<string>Default-667h</string>
<key>UILaunchImageOrientation</key>
<string>Landscape</string>
<key>UILaunchImageSize</key>
<string>{375, 667}</string>
</dict>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>8.0</string>
<key>UILaunchImageName</key>
<string>Default-736h</string>
<key>UILaunchImageOrientation</key>
<string>Landscape</string>
<key>UILaunchImageSize</key>
<string>{414, 736}</string>
</dict>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>8.0</string>
<key>UILaunchImageName</key>
<string>Default-568h</string>
<key>UILaunchImageOrientation</key>
<string>Landscape</string>
<key>UILaunchImageSize</key>
<string>{320, 568}</string>
</dict>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>8.0</string>
<key>UILaunchImageName</key>
<string>Default-667h</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{375, 667}</string>
</dict>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>8.0</string>
<key>UILaunchImageName</key>
<string>Default-736h</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{414, 736}</string>
</dict>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>8.0</string>
<key>UILaunchImageName</key>
<string>Default-568h</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{320, 568}</string>
</dict>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>8.0</string>
<key>UILaunchImageName</key>
<string>Default</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{320, 480}</string>
</dict>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>8.0</string>
<key>UILaunchImageName</key>
<string>Default</string>
<key>UILaunchImageOrientation</key>
<string>Landscape</string>
<key>UILaunchImageSize</key>
<string>{320, 480}</string>
</dict>
</array>
<key>UILaunchImages~ipad</key>
<array>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>8.0</string>
<key>UILaunchImageName</key>
<string>Default8</string>
<key>UILaunchImageOrientation</key>
<string>Portrait</string>
<key>UILaunchImageSize</key>
<string>{768, 1024}</string>
</dict>
<dict>
<key>UILaunchImageMinimumOSVersion</key>
<string>8.0</string>
<key>UILaunchImageName</key>
<string>Default8</string>
<key>UILaunchImageOrientation</key>
<string>Landscape</string>
<key>UILaunchImageSize</key>
<string>{768, 1024}</string>
</dict>
</array> |
|
Can confirm using nativeScale (available in iOS 8) fixes this issue on the normal iPhone 6 in zoomed mode. I don't have a 6+ to test with, however, and the sim isn't launching for the 6+. |
|
Hey folks, i hope i cam fix this up tomorrow. We've been busy getting
|
|
RoboVM doesn't yet expose the nativeScale method. Will fix this as soon as that's done on the RoboVM side. |
|
Could anyone explain how they're using native resolution/nativeScale in the mean time? I've been receiving complaints from iPhone 6 users that the scale in my game is wrong and I'm not really sure how to fix this. |
|
We patched everything ourselves
|
|
This should be fixed in the latest nightlies.
|
|
Can confirm that building this morning with gdxVersion = '1.3.2-SNAPSHOT' fixed the issue for me. Thanks! |
|
Worked for me as well! |
|
With the latest nightly build i have problems with input events (clicks) which are not workig! Anyone else have similar problems (on iOS 8)? Tnx! ext { |
|
This is happening only on iOS devices ... on Android and Desktop is working as expected ... |
|
Please create a new issue with an executable example that reproduces your problem. Closing this out. |
|
Was this commit intended to fix the issue? 062de10 The commit comment suggests it was just preparing for the fix, not fixing it. in iosrobovm/IOSApplication.java On the iPhone 6 Plus, my app still only fills 2/3 of the width and 2/3 of the height. Am I missing something or is this issue not actually fixed? |
|
Zoomed mode has not been fixed as RoboVM lacks a binding to the nativeScale
|
|
I've made the following change locally and it seems to solve this issue: Is there a problem with this simple solution? I've tested it across all iOS 8 devices in the simulator and each has the correct scaling with the fix. Without the fix, the iPhone 6 Plus is the only one scaled incorrectly. |
|
OK, this is all kinds of fucked it seems. I can get the nativeScale now (conditional on OS version). On iOS 8 on an iPhone 6 (plus) i get funky black bars to the left and right. UIScreen.getMainScreen().getBounds() reports 480x320, the scale is 3 on an iphone 6 plus, resulting in a width/height of 1440*960, on an iPhone 6 the scale is 2 resulting in 960x640 pixels scaled. This introduces funky black bars: http://libgdx.badlogicgames.com/uploads/Screen%20Shot%202014-10-03%20at%2017.11.41-CRQw8sLJcg.png I know nothing about iOS UI programming, anybody got an idea? |
|
So, here's the commit with the latest "fixes" 5f28c1f No idea how to get the proper native screen resolution. Both scale and nativeScale return integer values, resulting in wrong pixel resolution and hence the black bars of death. Any hints appreciated. |
|
I found this useful http://www.paintcodeapp.com/news/iphone-6-screens-demystified fwiw |
|
@ericnondahl right, the problem is that the point sizes are wrong for iPhone 6(+). They stay at 480x320. I hope we don't have to add a launch screen... |
|
OK, launch images do the trick and let our apps run in "native" resolution. What a stupid trick... Fixed with the latest commit, should be available in the nightlies soon. |
|
It's all working for me with latest nightly. Thanks |
in IOSGraphics.java, the code only handles device scale == 2. Since the 6+ has scale of 3, games are shrunk to a corner of the screen in the 6+. We need to modify this to simply multiply by the scale in all cases.
There is also a perhaps more subtle bug on the iPhone 6 in "zoomed" mode. In a similar way, the game is restricted to a corner of the screen. Not exactly sure here what the fix is, still diagnosing it.