- Corona SDK Mobile Game Development:Beginner's Guide(Second Edition)
- Michelle M. Fernandez
- 309字
- 2021-07-23 19:37:22
Time for action – adding the build.settings file
The build-time properties can be provided in an optional build.settings
file, which uses the Lua syntax. The build.settings
file is used to set the application orientation and autorotation behavior along with a variety of platform-specific build parameters. To add the build.settings
file in your project folder, perform the following steps:
- Create a new project folder called
Breakout
on your desktop. - In your preferred text editor, create a new file called
build.settings
and save it in your project folder. - Type in the following lines:
settings = { orientation = { default = "landscapeRight", supported = { "landscapeLeft", "landscapeRight" }, } }
- Save and close the file. The
build.settings
file is completed.
What just happened?
The default orientation setting determines the initial launch orientation on the device and the initial orientation of the Corona simulator.
The default orientation doesn't affect Android devices. The orientation is initialized to the actual orientation of the device (unless only one orientation is specified). Also, the only supported orientations are landscapeRight
and portrait
. On a device, you can flip to either landscapeRight
or landscapeLeft
, but the operating system only reports one flavor of landscape, and Corona's orientation event chooses landscapeRight
.
We have created this application to work with landscape orientations that support landscapeRight
. We have set this orientation as its default so it won't switch to landscapeLeft
or even any portrait
mode. While working on an iOS device, if the build.settings
isn't set before launching the application, it will go to the default portrait mode.
Dynamic scaling
Corona can target builds made for multiple devices across iOS and Android, which display various art assets in different resolutions. Corona can scale upward or downward depending on your starting resolution. It can also substitute higher-resolution image files when needed, ensuring that your app appears clear and sharp on all devices.
- 一步一步學Spring Boot 2:微服務項目實戰
- jQuery Mobile Web Development Essentials(Third Edition)
- 零基礎PHP學習筆記
- Visual C++串口通信開發入門與編程實踐
- C#完全自學教程
- Python零基礎快樂學習之旅(K12實戰訓練)
- 嚴密系統設計:方法、趨勢與挑戰
- SQL Server從入門到精通(第3版)
- Android開發案例教程與項目實戰(在線實驗+在線自測)
- 移動界面(Web/App)Photoshop UI設計十全大補
- Python算法詳解
- Node.js:來一打 C++ 擴展
- Distributed Computing in Java 9
- IoT Projects with Bluetooth Low Energy
- Visual Basic程序設計實驗指導及考試指南