iPhone-x full screen support for old projects

iPhone-x full screen support for old projects
0.0 0

#1

I just upgraded xcode to latest version 9.1 for iPhone-x testing
Compiled my old game made with cocos2d-x 3.15.1 c++
Game is not coming full screen on iPhone-x


I found github pull request for that : Found here
But it has 64 files changed so it will be difficult for me to integrate into old projects.
So i think we have two options,

  1. wait for 3.17 and upgrade engine, but when it will come out?
  2. Any short ways to add this patch in old projects?
    @dumganhar @slackmoehrle

Also, i think we have to remove that white-line home indicator as well for games. For more details


#2

I don’t think so. Engineers are working on deadlines for new releases. We wont back port this fix.

v3.17 will be released around 2-3 months from now.


#3

Thats big gap.


#4

Yeah, I can see that. Can you try and upgrade a game to GitHub Master? Or is that not an option while v3.17 is being worked on?


#5

We normally use stable release version (zip file), so we cannot upgrade to GitHub.
We develop for clients as well so its easy to manage via zip stable release.
Anyways i found this article , trying to implement that way with old project, if its easy then will do it for all projects.
I think its not that big work, as it says we have to adopt Storyboard instead of Static Launch Images.
I will let you know.


#6

right, I also know this is what devs are doing.


#7

Adding storyboard or launch image will just give u a full resolution of the device. Launch image is possible for iPhone X.

Next you have to fix your UI. Designing for iPhone X


#8

Yes, that i know.


#9

So, engine update has nothing to do with iPhone X, you just need to add LaunchImage 1125 × 2436. Done.

And even, I strongly recommend NOT using storyboards, because you will get full screen of iPad Pro 12.9" - 2048 x 2732px , which is don’t needed actually, because without it adaptation its telln system that its iPad Air and just scale up all using built in iOS system, image looks very good. I bet that Apple do some non linear scaling, so it should better look than getting full canvas and anyway upscaling you game resource. Or you have res for that iPad… I don’t think so.


#10

Ok, can you tell me naming convention for that?

Did you find the solution for this too?


#11

Have you tried? It will just work. Don’t need anything else.


  • (BOOL)prefersHomeIndicatorAutoHidden
    {
    return YES;
    }

#12

I already tried this before, but not working.


#13

I don’t have device lol, can’t help :smiley: maybe it will on the device. BUt I’ve talked about naming convention.


#14

I dont have either.
But Home Indicator should hide on emulator too.
Currently with storyboards game is running in full screen, so i am trying to set everything first like Ads, home-indicator etc
After that i will try with launchimage, but afaik naming convention is very important for it.
Thanks for your help.
I will post here if any solution is working for home-indicator.


#15

Current iOS iPhone X simulator is crap. And other too, works too slow. I never used it since last update to Xcode 9. And this can be just a bug.


#16

Apple solved this issue.


#17

On my Mac, no.


#18

Should use Xcode 9.1.


#19

Yeah, it seems working Okay.

This code we have to add in RootViewController.mm after that its working.
BUT
it just hide the home-indicator, actually we have to disable it.
Means user must swipe twice to go home screen.
But i didnt find solution yet.
@zhangxm Do you find solution for this?


#20

If you haven’t figured it out, this is what I’ve found that seems to work.

- (void)viewDidLoad {
    [super viewDidLoad];
    if (@available(iOS 11.0, *)) {
        // This should only be necessary if you changed the return value of the property
        // `BOOL preferredScreenEdgesDeferringSystemGestures`, but in limited testing needed this
        [self setNeedsUpdateOfScreenEdgesDeferringSystemGestures];
    } else {
        // Fallback on earlier versions
    }
}

// NOTE(steve): meant more for hiding in passive use where touches are infrequent
- (BOOL)prefersHomeIndicatorAutoHidden {
    // NOTE(steve): setting this to yes causes the defer system edge gestures to not work
    //return YES;
    return NO;
}

- (UIRectEdge)preferredScreenEdgesDeferringSystemGestures
{
    return UIRectEdgeAll;
    // NOTE(steve): should probably just defer the bottom swipe (home gesture)
    //return UIRectEdgeBottom;
}