Skip to content

Supports full screen for iPhone X and uses Storyboard for launch screen. #18276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Sep 19, 2017

Conversation

dumganhar
Copy link

@dumganhar dumganhar commented Sep 15, 2017

For developer's project, please follow the steps:

  • Copy LaunchScreen.storyboard and LaunchScreenBackground.png to proj.ios or ios folder.

d86ac683-e9cb-4dd5-a918-4d3bd281ce94

  • Add LaunchScreen.storyboard and LaunchScreenBackground.png to project, and add them to Build Phases -> Copy Bundle Resource too.

a362eed6-3de8-47be-8512-529f5ff89fc8

  • Set Launch Screen File to LaunchScreen.

6081272d-e85f-43ba-8a90-e0e783908544

Discussion: http://discuss.cocos2d-x.org/t/iphone-x-slow-transitions-xcode-bug-and-not-full-screen-solved/38942

@dumganhar dumganhar requested a review from minggo September 15, 2017 08:43
@minggo
Copy link
Contributor

minggo commented Sep 15, 2017

I think we can remove other background images after testing iOS 6+.

@dumganhar
Copy link
Author

If we don't care about iOS 6, yes, we could remove them.

@linshun
Copy link
Member

linshun commented Sep 15, 2017

Remove the old old age and old old platform images.

@dumganhar
Copy link
Author

  • Removes unused LaunchScreen images.
  • Updates template projects configuration for iOS.

Sorry, something went wrong.

@minggo minggo merged commit 0c5ba22 into cocos2d:v3 Sep 19, 2017
@minggo minggo added this to the next milestone Sep 19, 2017
stevetranby added a commit to stevetranby/cocos2d-x that referenced this pull request Sep 20, 2017
* commit 'a5374d0411fd45ffbebe732f579fe302aa95ce04':
  Fix minor typos (cocos2d#18289)
  Supports full screen for iPhone X and uses Storyboard for launch screen. (cocos2d#18276)
  use error macro to replace constant value 1410L (cocos2d#18264)
  Fix VAO in CameraBackgroundBrush (cocos2d#18278)
@jacket-code
Copy link

I found a bug, I use v3.16 and merge this commit, but the utils::captureScreen is not right, you can see my pic, a half of screen is back, using v3.15.1, I don't have this problem
img_6445

@wjezxujian
Copy link

wjezxujian commented Oct 30, 2017

How can i do it in the safearea? We must support iOS7!

@dumganhar
Copy link
Author

@jacket-code , I have no idea of that. Could you upload a demo or code snippet for this issue?

How can i do it in the safearea? We must support iOS7!

@wjezxujian , as I know, if you wanna you game running on iPhone X, you have to use Storyboard for making a full screen display.
Currently, iOS7 has few devices and iPhoneX is a big cake.
You could refer to https://developer.apple.com/support/app-store/

screen shot 2017-10-31 at 11 08 39

@dumganhar
Copy link
Author

@wjezxujian , if setting deployment target to 7.0 and run your game in Xcode 9, you will get this error:

screen shot 2017-10-31 at 11 34 56

So, if you wanna iOS 7 support, go back to Xcode 8, if you wanna the big cake of iPhoneX, go to use Xcode 9 and forget about iOS7.

@wjezxujian
Copy link

@dumganhar Our game has been shipped for 2 years。Recently,we need to make new content that for match iphoneX resolution。if it possible our content can be display fully in the safe area of iphoneX?Because some content that can not be displayed in the face id camera。

@dumganhar
Copy link
Author

@wjezxujian , this Pull Request just make your game display in full screen (2436 x 1125) including the area being cut out.
You have to re-layout your game elements for iPhoneX in order not to be covered by the camera area.

Currently, Director::getInstance()->getFrameSize() should return 2436x1125 size and Application::getInstance()->getTargetPlatform() return iphone enum. By this two factors, you could indicate it's iPhoneX. And you could hack some code to adjust game UI.

@ShuraLiu
Copy link
Contributor

ShuraLiu commented Nov 1, 2017

@dumganhar is there any plan to support ios11 safe area? I think it need to rewrite the RootViewController but i have no idera how to make it right

@wjezxujian
Copy link

@dumganhar,I have no idea,can you give me some suggestion?

@ShuraLiu
Copy link
Contributor

ShuraLiu commented Nov 3, 2017

@wjezxujian The engine can not deal with safe area in ios11. In my project, i render my scene to rendertexture with our design size, and put the rendertexutre in center of scene. You can have a try.

@cmqzpp
Copy link

cmqzpp commented Jan 5, 2018

@dumganhar

@cnbcloud
Copy link

cnbcloud commented May 28, 2018

@dumganhar according to the method provided by you,my game launch scene can be displayed in full screen ,but other scenes still have black edges,how can i do it,and i hope you can reply,thanks

@drelaptop
Copy link
Contributor

@cnbcloud I think you could refer to safe area at Apple docs
https://developer.apple.com/ios/human-interface-guidelines/overview/iphone-x/

set a full screen background to avoid black edges, and put you UI into safe area.

please run cpp-empty-test using cocos2d-x 3.17 on iPhone X, to see the full screen background and safe area

@cnbcloud
Copy link

cnbcloud commented May 29, 2018

@drelaptop Thank you for your reply. my problem has been solved, but I have encountered a new problem. the pop-up of the edit box input on iphone x will affect the ui layout.do you have some idea

@drelaptop
Copy link
Contributor

@cnbcloud suggest to new a issue, describe it in detail, and it's better to add some screenshot.

@yuan282828sc
Copy link

为什么 我的项目按照这种方式改了之后 黑屏 打不开了呢? 求大神指点迷津。。。。。。。。。。。。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants