iOS fullscreen on iPad

Hi,

How to change project cpp-empty-test to full screen?
Currently on simulator and device I see following:

Regards,
CHP

I created a new project like this:
cocos new MyGame -p com.MyCompany.MyGame -l cpp -d ~/MyCompany

And i see it in full-screen mode on iPads…

@CrazyHappyGame did you change anything in AppDelegate or perhaps using an old version of that class?

@slackmoehrle below steps how to reproduce it:

~ $ sw_vers
ProductName: Mac OS X
ProductVersion: 10.14.2
BuildVersion: 18C54
~ $ /usr/bin/xcodebuild -version
Xcode 10.1
Build version 10B61
$ git clone https://github.com/cocos2d/cocos2d-x.git
$ cd cocos2d-x/
$ git checkout cocos2d-x-3.17.1
$ ./download-deps.py
$ mkdir b
$ cd b
$ cmake .. -GXcode -DCMAKE_TOOLCHAIN_FILE=../cmake/ios.toolchain.cmake -DIOS_PLATFORM=SIMULATOR64
$ open Cocos2d-x.xcodeproj

In Xcode:
cpp-empty-test->iPad (5th generation)
run

@slackmoehrle
The same is for cpp-tests and iPad (5th generation)

@tranthor
You are right it works fine for new project (e.g.: ./cocos new MyGame -p com.MyCompany.MyGame -l cpp)

Observations:

  1. cpp-template-default (used for “cocos new”) - has one folder proj.ios_mac
    https://github.com/cocos2d/cocos2d-x/tree/v3/templates/cpp-template-default
  2. cpp-empty-test (cpp-tests and all other tests projects) - has two folders proj.ios and project.mac
    https://github.com/cocos2d/cocos2d-x/tree/v3/tests/cpp-empty-test
  3. source code for cpp-template-default != cpp-empty-test

@slackmoehrle @drelaptop
Questions:

  1. Why “cpp-empty-test” and “cpp-template-default” have different folder structure, and different source files *.cpp, *.h *.mm. I think that “cpp-empty-test” should be the same as “cpp-template-default”
  2. Does CMake works for “cpp-template-default” with one folder proj.ios_mac? Does any one test it? There is no travis CMake build for that https://github.com/cocos2d/cocos2d-x/blob/v3/tools/travis-scripts/run-script.sh#L88

It works, In CMake scripts the only difference with one folder or two folder is resources path, you can found it at below:

@drelaptop Thank you for confirmation about cmake.
What about folder structure. Why there is “proj.ios and proj.mac” for cpp-tests and “proj.ios_mac” for default template.
Why cpp-test and cpp-empty-test is not full-screen on iOS?

theoretically, it should be.

but maybe In the history, someone commit a feature to improve template, but no care tests project. so it is…

try to diff cpp-template with cpp-empty-test to found a result

In XCode please select:

  • Devices -> Universal
  • check “Requires full screen”
1 Like