- Corona SDK Mobile Game Development:Beginner's Guide(Second Edition)
- Michelle M. Fernandez
- 246字
- 2021-07-23 19:37:22
Time for action – adding the config.lua file
If no content size is specified, the content width and height returned will be the same as the physical screen width and height of the device. If you specify a different content width and height in config.lua
, the content width and height will take on those values. To add the config.lua file in your project folder, perform the following steps:
- In your text editor, create a new file called
config.lua
and save it to your project folder. - Type in the following lines:
application = { content = { width = 320, height = 480, scale = "letterbox", fps = 60, }, }
- Save and close your file.
What just happened?
The content width and height allow you to choose a virtual screen size that is independent of the physical device screen size. We have set the size to target the iPhone 3GS since it displays one of the common dimensions across most devices for both iOS and Android platforms.
The scale used for this application is set to letterbox
. It will uniformly scale up content as much as possible while still displaying all content on the screen.
We set fps
to 60
. By default, the frame rate is 30 fps. In this application, this will make the movement of the ball appear faster and allow us to increase the speed conveniently. We can stretch the frame rate to 60 fps, which is the maximum that Corona can allow.
- MATLAB 2020 從入門到精通
- Learning SAP Analytics Cloud
- 編寫高質量代碼:改善Python程序的91個建議
- HTML5游戲開發案例教程
- JavaScript by Example
- Microsoft System Center Orchestrator 2012 R2 Essentials
- Java Web程序設計任務教程
- HTML5從入門到精通(第4版)
- The Professional ScrumMaster’s Handbook
- Citrix XenServer企業運維實戰
- Python硬件編程實戰
- 現代CPU性能分析與優化
- Mastering PowerCLI
- FusionCharts Beginner’s Guide:The Official Guide for FusionCharts Suite
- 零基礎學Java(第5版)