@zhangxm Logging in upfront was the solution to see the issue.
LaunchScreen and resolution fix for iPhoneX is here:
Yeah, I used your pull request and it worked very well. As far as I understand, the PNG has to be in the iPhone X resolution and will be scaled to the device (and the constraints hold the image within the screen). Nice.
Yes, we use
Aspect Fill for the background (ImageView) of launch screen. Therefore, the scaled image will keep the aspect of width and height.
Storyboards and constrains are so crap… I’ve worked ~1 year overall with all this…, developing enterprise apps. Overall UX of developing View’s and storyboard are so awkward… I even can’t believe that Apple created it…
And with Aspect Fill you will get you launch screen cut off top bottom for iPad, well some games probably wanted to have some information there, as my current… and also I have specific scale for my game, so my intro screen is different(but same visually) than created and scaled in storyboard.
Just simple: I have a text in the center of the screen and I just want it size be changed like follows - iPhone 10px and iPad 20px, so as usually we scale resources 1x(0.5) and 2x(1.0).
And you can’t do that in storyboard just simple. Note that the launch screen is not a fully customizable view controller. You cannot specify a custom class name in the storyboard and expect the system to give you the option to execute code at this stage by calling viewDidLoad. Remember, the app hasn’t launched yet. So, you can’t edit it in a code, I wanted just change label size accordingly.
So, I suggest just always use a png file for that(just in case someone waned to try UI from Apple), but in my case I want to save .ipa size and create simple launch screen with color background and text… anyway I can’t.
Moreover, we have now iPad pro 12.9 online with adding this storyboard, so it’s full resolution will be passed, imagine results?
Currently, with just launch images for iPhone 5,6,7(let’s say old method) you can’t have a full resolution of iPad 12.9, it’s works like as usual iPad 2048x1536 and upscaled by hardware, which works best.
@KAMIKAZE an alternative to a storyboard is an Asset Catalog. I have tested this with cocos2d-x and it works with the iPhone X. However, I needed to add a new iOS Launch Image set to make it work.
Can you show some screen shoots of you game\demo from cocos2d-x to iPhone x ? What resolution you get? canvas size?
This will help with resolutions: http://iosres.com/
You can use an AssetCatalog or Storyboard or simply just create your launch image with the correct filename:
Default-Landscape@3x~ipad.png it also must be the correct size according to the first link I posted (also in the developer docs link above too)
Ah, for some reason I missed checkbox for for X model, now I see. Thanks.
Been looking into adding an Asset Catalog and discovered they don’t support iPad Pro. Perhaps a Storyboard is the only way to go?
Yes, thats I know for 100%, only storyboard will enable it full resolution.
@Rusty can Asset Catalog work for all resolutions?
@slackmoehrle have you tried it? Just add a new launch image can make iPhone X full screen? @dumganhar tried to add a new launch image for iPhone X, but can not make it full screen. I think it is the best way if it works since sotryboard can work on iOS 8.0+. And cocos2dx suppors iOS 6.0+.
@zhangxm Nope, Asset Catalog doesn’t support iPad Pro. I’m now using a Storyboard instead.
Got it, so storyboard is the only solution for all resolutions.
Using StoryBoard requires Xcode 8.0+ and iOS 8.0+. I think it is not a big issue.
I would not recommend to use a full resolution, why it’s actually needed for you?
Anyway it’s should be upscaled from usual iPad resources(4x like for games), so it will be blurred anyway.
iPad Pro currently doing that upscale automatically and I think with much better quality, because it’s built in, Apple take care about all this. So you need just to provide launch images for usual iPad’s and finally on iPad Pro you good, nothing more todo. But with storyboard you should probably adopt something, because you will get 2048x2732px canvas and I think upscale from cocos will be worse quality than Apple does(if anyone can clarify about this I would happy to listen).
So for me, I never using storyboard and have no problems…
The default configuration (in https://github.com/cocos2d/cocos2d-x/pull/18276) for storyboard is a background image which is aspect fill.
I think it’s just a demonstration with storyboard for launch screen. As my understanding, storyboard is some thing like
Layout stuff which is more powerful for layout UI elements since it’s provided for layout native controls in iOS . You could just use a background image for launch screen or several UI controls, for example,
background image cut off problem is not a big deal and could be avoided. It’s based on how you design the launch screen with storyboard.
What’s more, I only figure out that
storyboard is the only way to make full screen on iphone X. If you could find other approaches to make it work, feel free to let us know.
Without full screen, engine can not get correct size of screen, and can not render in full screen for games that need it.
Yes, but how do you make it UILabel size 80px on iPad(2048x1536) and 40px on iPhone(1136x640) ?
It’s not need to, all upscale will be done by iOS and if your game cocos code work well on iPad(2048x1536) you don’t need to do anything.
I guess you as cocos engine developer should test on all iOS devices family? You have it all? iPhone’s: 5,6,7+ and iPad’s: mini 2, 4 and iPad Air 1, iPad Pro 12.9, etc.
buying devices for testing purposes is just will not be noticed for budget. So you probably already tested and saw that if no launch image provided for example for iPhone 6+, iOS will upscale it and you don’t need to do anything. That how it worked when 6+ was released and no adaptation were done for it. Same for iPad Pro, but will you provide something like 6x or 8x resources for it in your game?
Or why do you need so large canvas? It’s not needed for games.