Highlighted

iOS game launches off-center on some phones, sometimes

Community Beginner ,
Aug 08, 2017

Copy link to clipboard

Copied

Hi. I'm developing an iOS game. I'm using Animate CC and Flash Develop using Air for deployment and working on a PC.

Here's the problem. On iPhone 6 the game shows the splash screen and then launches fine. On iPhone 6 PLUS the game shows the splash screen fine, but then sometimes launches off-center. Repeat it only does this sometimes. It's not every time but it's alot. Screen shots below.

offcenter bug final.jpg

So just by looking at this picture myself. It looks like the game gets stuck thinking it's on a different device. The game logo is set to appear at stage.stageHeight / 3.45; Assuming that line is working correctly, then for some reason the game thinks the screen is bigger than it is..ofcourse, i have NO idea why the xposition is so off. Also, the game totally freezes at this point (just showing the partial logo) whereas it will run smoothly on the times that launches correctly.

I have a feeling it has something to do with my splashscreen files and/or the way I'm setting up something in my xml or settings. Here's what I have going on.

Main Animate File size: 750x1334

Air Version: 25.0

In my document main class:

stage.scaleMode = StageScaleMode.NO_SCALE;

stage.align = StageAlign.TOP_LEFT;

stage.scaleMode = StageScaleMode.NO_BORDER

(I manually position  ui/game elements via code, based on "fullScreenWidth/Height" later in the code.)

My goal is to target just iPhone 5,6,7, 6plus, and 7plus at the moment, here are my splashscreen included files:

Default-414w-736h@3x~iphone.png

Default-375w-667@2x~iphone.png

Default-568h@2x~iphone.png

And this is from the xml file:

<autoOrients>false</autoOrients>

<fullScreen>true</fullScreen>

<aspectRatio>portrait</aspectRatio>

<renderMode>direct</renderMode>

Maybe I missed something? ..something super easy I hope!

TOPICS
Development

Views

373

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

iOS game launches off-center on some phones, sometimes

Community Beginner ,
Aug 08, 2017

Copy link to clipboard

Copied

Hi. I'm developing an iOS game. I'm using Animate CC and Flash Develop using Air for deployment and working on a PC.

Here's the problem. On iPhone 6 the game shows the splash screen and then launches fine. On iPhone 6 PLUS the game shows the splash screen fine, but then sometimes launches off-center. Repeat it only does this sometimes. It's not every time but it's alot. Screen shots below.

offcenter bug final.jpg

So just by looking at this picture myself. It looks like the game gets stuck thinking it's on a different device. The game logo is set to appear at stage.stageHeight / 3.45; Assuming that line is working correctly, then for some reason the game thinks the screen is bigger than it is..ofcourse, i have NO idea why the xposition is so off. Also, the game totally freezes at this point (just showing the partial logo) whereas it will run smoothly on the times that launches correctly.

I have a feeling it has something to do with my splashscreen files and/or the way I'm setting up something in my xml or settings. Here's what I have going on.

Main Animate File size: 750x1334

Air Version: 25.0

In my document main class:

stage.scaleMode = StageScaleMode.NO_SCALE;

stage.align = StageAlign.TOP_LEFT;

stage.scaleMode = StageScaleMode.NO_BORDER

(I manually position  ui/game elements via code, based on "fullScreenWidth/Height" later in the code.)

My goal is to target just iPhone 5,6,7, 6plus, and 7plus at the moment, here are my splashscreen included files:

Default-414w-736h@3x~iphone.png

Default-375w-667@2x~iphone.png

Default-568h@2x~iphone.png

And this is from the xml file:

<autoOrients>false</autoOrients>

<fullScreen>true</fullScreen>

<aspectRatio>portrait</aspectRatio>

<renderMode>direct</renderMode>

Maybe I missed something? ..something super easy I hope!

TOPICS
Development

Views

374

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 08, 2017 0
Community Beginner ,
Aug 09, 2017

Copy link to clipboard

Copied

I did some estimating, and it looks like my app, when not working, thinks it's on a device with a stage size of approx 2300x2900. (This is based on how the background image and logo are incorrectly placed and also how they are coded to be placed. Any idea why it's doing this?

Maybe I'm not even on the right track here...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 09, 2017 0
Community Beginner ,
Aug 28, 2017

Copy link to clipboard

Copied

This is still not solved, but I have an update. I recently got my app running on iPad Air 2. It loads and runs perfectly about 50% of the time. The other 50% it looks like this (below). Notice the space on the right edge. Basically, the launch image is fine, but once the app loads it moves (just like in iPhone 6+/7+). This time, the app shifts to the left like..20px? Also, the app thinks it has much more vertical space than it really does - notice how my UI elements continue well below the bottom edge of the screen.

This test was done using AIR 25.

It's really hard to figure this out because it only happens 50% of the time. I can close the app, restart it and it will work. Sheesh...

iPadAir_offcenter.JPG

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 28, 2017 0
Engaged ,
Aug 28, 2017

Copy link to clipboard

Copied

Can you find out what screen width & height it is using by showing them in a textbox or getting trace statements in Scout? Do these figures change if you let it keep running or does the app hang?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 28, 2017 0
Participant ,
Sep 06, 2017

Copy link to clipboard

Copied

I have a feeling that this has to do with your getting the stage size immediately.  In my experience some devices do not launch with the final stage size.  Thus what I've done is add a stage resize event.  Once that even is called, you can set global variables for stage width/height as well as begin placing things and arranging them on the stage. 

One other thing to note is that I use Stage.stageWidth and Stage.stageHeight to get the dimensions as opposed to fullScreenWidth/Height.

Hopefully one of these tips works for you.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 06, 2017 0