iPhone 6 Plus viewport incorrect ?

46 views
Skip to first unread message

Mickael Barbeaux

unread,
Nov 13, 2015, 6:05:05 AM11/13/15
to PlayN
Hi everyone,

I developed a small game working successfully on differents platforms (Java, HTML, Android).
When coming to deploy to iOS with RoboVM, I had successfull results on multiple devides (iPhone 3GS, iPhone 4S and iPhone 5).

But when trying to deploy and run on an iPhone 6 Plus, despite the game is correctly running, the display is incorrect. It seems that the viewport isn't correctly managed.

As examples is oftenly better than words, here's the problem with a simple demo just displaying an ImageLayer containing the Apple logo.
On the iPhone 3GS / iPhone 4S / iPhone 5, everything is ok (image is correctly displayed at the origin position).





But on the iPhone 6 Plus (maybe other devices too ?) the image doesn't appear at the correct position, seems like the origin of the ImageLayer is out of the screen, we can only see a small bottom part of the image.





Any idea about how to correct that ? Is it something part of RoboVM ?


Michael Bayne

unread,
Nov 15, 2015, 10:11:59 AM11/15/15
to pl...@googlegroups.com

On Fri, Nov 13, 2015 at 3:05 AM, Mickael Barbeaux <mbar...@gmail.com> wrote:
Any idea about how to correct that ? Is it something part of RoboVM ?

I have not seen problems on iPhone 6+. Can you post source, or try running the PlayN samples on your 6+ to see if they work properly and compare your code to their to see what you might be doing differently?

Mickael Barbeaux

unread,
Nov 15, 2015, 10:49:44 AM11/15/15
to PlayN
Hi Michael.

Even with the simpliest project, I can reproduce the problem.
I just took the PlayN sources from GitHub, built it with Maven, generated an empty project with the Maven archetype (2.0-SNAPSHOT) and then, the Main class just looks like this :


package com.mbarbeaux.project.core;

import playn.core.Platform;
import playn.scene.ImageLayer;
import playn.scene.SceneGame;

public class Main extends SceneGame {

private static final int UPDATES_PER_SECOND = 30;

public Main(final Platform plat) {
super(plat, (int) (1000f / UPDATES_PER_SECOND));
rootLayer.add(new ImageLayer(plat.assets().getImage("images/apple-logo.png")));
}

}

As you can see, it's just the matter of adding an ImageLayer to the scene root layer, nothing else. I did not change anything else in the other projects.

I tried running the HelloWorld example displaying an background image, and the image displayed showed the same problem (viewport was not centered on the top left corner of the image).
I didn't try the PlayN samples but I will give it a try in the next couple of hours.

Michael Bayne

unread,
Nov 15, 2015, 11:00:53 AM11/15/15
to pl...@googlegroups.com

On Sun, Nov 15, 2015 at 7:49 AM, Mickael Barbeaux <mbar...@gmail.com> wrote:
I tried running the HelloWorld example displaying an background image, and the image displayed showed the same problem (viewport was not centered on the top left corner of the image).
I didn't try the PlayN samples but I will give it a try in the next couple of hours.

I just tried playn-samples/hello, modified to use 2.0-SNAPSHOT (it uses 2.0-rc2 by default) and it seems fine:

Inline image 1

So I'm not sure what is causing your trouble. Maybe make sure you're running the absolute latest 2.0-SNAPSHOT? (git pull in your playn checkout and mvn install it).


Michael Bayne

unread,
Nov 15, 2015, 11:02:11 AM11/15/15
to pl...@googlegroups.com

On Sun, Nov 15, 2015 at 8:00 AM, Michael Bayne <m...@samskivert.com> wrote:
I just tried playn-samples/hello, modified to use 2.0-SNAPSHOT (it uses 2.0-rc2 by default) and it seems fine:

Oh, it occurs to me that this doesn't have a splash screen that triggers "true" iPhone 6+ mode, so let me check that.

Mickael Barbeaux

unread,
Nov 15, 2015, 11:09:24 AM11/15/15
to PlayN
I tested on launching the "mvn clean install -Probodev" command inside the test directory of the main PlayN repository source.
Everything went fine on install (as I'm using iOS 9.1, I had to change the "app.id" of the robovm.properties file in order to fullfil a custom provisionning profile) but I changed nothing else.


When running, I obtain this :


  (portrait mode)


 (landscape mode)



As you can see, the layers aren't positionned correctly at the (0,0) coordinates.

The most fascinating is that the Touch events worked correctly (I mean they are launched at the correct positionning). For example, if I tap on the "Canvas Stress" button, it actually performs as if I tapped the "Canvas" button. And to click on the "Canvas" button, I must tap on the back part of the top of the screen, I mean the place where the button should have been displayed

Michael Bayne

unread,
Nov 15, 2015, 11:17:33 AM11/15/15
to pl...@googlegroups.com

On Sun, Nov 15, 2015 at 8:02 AM, Michael Bayne <m...@samskivert.com> wrote:
Oh, it occurs to me that this doesn't have a splash screen that triggers "true" iPhone 6+ mode, so let me check that.

I just created a new test app, ensured that it had an iPhone 6+ sized launch image (and that that image was shown) and it also seems fine:

Inline image 1

and the PlayN test app is also working fine for me:

Inline image 2

What version of Xcode are you using? I am using Version 7.1.1 (7B1005).

Perhaps yours is older or newer?


Mickael Barbeaux

unread,
Nov 15, 2015, 11:19:28 AM11/15/15
to PlayN
Sorry for my bad english, maybe it'll be more clear with an image of what occurs :


Michael Bayne

unread,
Nov 15, 2015, 11:22:54 AM11/15/15
to pl...@googlegroups.com
On Sun, Nov 15, 2015 at 8:19 AM, Mickael Barbeaux <mbar...@gmail.com> wrote:
Sorry for my bad english, maybe it'll be more clear with an image of what occurs :

Yeah, I'm not sure what exactly is going wrong, but probably the GL framebuffer is too big, and so since it renders pixels from the lower left (due to flipping the y axis to overcome GL's coordinate system), it doesn't end up rendering things as big as it expects. But the touch event system is doing its own math and so it ends up calculating the correct position for the buttons, even though they're not drawn there.

However, I unfortunately don't have iPhone 6+ hardware to test on, so I can only run things in the simulator, where they appear to work just fine. Can you try running the iPhone 6+ simulator and see if those work for you or if they also show this problem?

Mickael Barbeaux

unread,
Nov 15, 2015, 11:27:14 AM11/15/15
to PlayN
I don't own a Mac computer, so I'm running with VMWare. I'm using MacOSX Yosemite 10.10.5 with XCode 7.1.1 (7B1005)

Michael Bayne

unread,
Nov 15, 2015, 11:28:33 AM11/15/15
to pl...@googlegroups.com

On Sun, Nov 15, 2015 at 8:22 AM, Michael Bayne <m...@samskivert.com> wrote:
However, I unfortunately don't have iPhone 6+ hardware to test on, so I can only run things in the simulator, where they appear to work just fine. Can you try running the iPhone 6+ simulator and see if those work for you or if they also show this problem?

Also, when you run any game on the simulator or device, it should report something like this to the logs:

[ERROR] 2015-11-15 08:25:45.952 TestsGameRoboVM[91060:21100646] INFO: viewPortChanged 960x1704 / 3.0 -> 320.0x568.0

That's from running the test app on the iPhone 6+ simulator. What does it report when running on the real iPhone 6+?

Mickael Barbeaux

unread,
Nov 15, 2015, 11:33:29 AM11/15/15
to PlayN
I have this on the console log :

2015-11-15 17:31:05.887 TestsGameRoboVM[305:39494] INFO: Right click, touch with two fingers, or type ESC to return to test menu.
2015-11-15 17:31:05.951 TestsGameRoboVM[305:39494] INFO: viewPortChanged 640x1136 / 2.0 -> 320.0x568.0


Also, what do you mean by spash screen ? Is it something generated by the archetype ? Or must I add it manually ?
Because I don't think I'm using one...

Michael Bayne

unread,
Nov 15, 2015, 11:42:42 AM11/15/15
to pl...@googlegroups.com
On Sun, Nov 15, 2015 at 8:33 AM, Mickael Barbeaux <mbar...@gmail.com> wrote:
2015-11-15 17:31:05.951 TestsGameRoboVM[305:39494] INFO: viewPortChanged 640x1136 / 2.0 -> 320.0x568.0

That looks like it's in iPhone 5 emulation mode. Which it probably is because the test app has old splash screens.

Also, what do you mean by spash screen ? Is it something generated by the archetype ? Or must I add it manually ?

The newest archetype automatically adds splash screens to trigger native resolution on iPhone 5 and iPhone 6, but it does not add a splash screen to trigger native resolution on iPhone 6+ which means the OS will use iPhone 6 "emulation" mode.

It's very strange that things are not working in the case you show above, but there's not much more I can do to debug it without an actual iPhone 6+ device, so I'm afraid I can't be of much help until I track one of those down.

I *believe* that things should work on an iPhone 6+ when running in iPhone 5 emulation mode, because I recently updated a shipped commercial game using PlayN which uses iPhone 5 emulation mode on newer devices and I haven't heard bug reports from iPhone 6+ users, but who knows.


Mickael Barbeaux

unread,
Nov 15, 2015, 12:59:12 PM11/15/15
to PlayN
I tried running on the iPhone6 Plus simulator, and it works perfectly.
So I don't know.

Is your commercial game available on the french App Store ? Maybe I can't try if there is a free trial version of it ?
I remember testing SpellWood few months ago on my 6+ and didn't have any problem like that, but I don't know if it was deployed using RoboVM or with the old Xamarin bundle.

Michael Bayne

unread,
Nov 15, 2015, 1:14:44 PM11/15/15
to pl...@googlegroups.com
On Sun, Nov 15, 2015 at 9:59 AM, Mickael Barbeaux <mbar...@gmail.com> wrote:
Is your commercial game available on the french App Store ? Maybe I can't try if there is a free trial version of it ?

Try the latest version of Spellwood, it's running on the RoboVM version of PlayN.

Mickael Barbeaux

unread,
Nov 15, 2015, 1:20:32 PM11/15/15
to PlayN
I tried SpellWood Lite (the free version), but it doesn't work at all now... The loading screen appears for 1 second and the app crashes...
Reading the infos on the AppStore, it seems it's an old version (last update on 30 october 2013). I remember it was working before, few months ago when I was running on iOS 8.2, so maybe it's not working anymore on iOS 9

Michael Bayne

unread,
Nov 15, 2015, 1:29:42 PM11/15/15
to pl...@googlegroups.com
On Sun, Nov 15, 2015 at 10:20 AM, Mickael Barbeaux <mbar...@gmail.com> wrote:
I tried SpellWood Lite (the free version), but it doesn't work at all now... The loading screen appears for 1 second and the app crashes...
Reading the infos on the AppStore, it seems it's an old version (last update on 30 october 2013). I remember it was working before, few months ago when I was running on iOS 8.2, so maybe it's not working anymore on iOS 9

Yeah, they were supposed to get rid of Spellwood Lite and make the main Spellwood SKU free. So Spellwood Lite has not been updated to work on iOS 9. I'll pester my contacts at SEGA (who own Spellwood, but I no longer work there).

Reply all
Reply to author
Forward
0 new messages