- 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.
- AngularJS深度剖析與最佳實踐
- Reactive Programming With Java 9
- Oracle BAM 11gR1 Handbook
- Learning Selenium Testing Tools(Third Edition)
- JavaScript:Moving to ES2015
- Mastering Drupal 8 Views
- Python深度學習:基于TensorFlow
- Mastering Xamarin.Forms(Second Edition)
- 零基礎輕松學C++:青少年趣味編程(全彩版)
- 實戰Python網絡爬蟲
- Serverless從入門到進階:架構、原理與實踐
- 微信公眾平臺服務號開發:揭秘九大高級接口
- Hands-On Game Development Patterns with Unity 2019
- 深入淺出Rust
- 網頁設計理論與實踐