- 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.
- 零起步玩轉掌控板與Mind+
- Hands-On Image Processing with Python
- 從程序員到架構師:大數據量、緩存、高并發、微服務、多團隊協同等核心場景實戰
- 神經網絡編程實戰:Java語言實現(原書第2版)
- Python Tools for Visual Studio
- 西門子S7-200 SMART PLC編程從入門到實踐
- Java零基礎實戰
- C語言程序設計實訓教程與水平考試指導
- RESTful Web Clients:基于超媒體的可復用客戶端
- Python數據可視化之美:專業圖表繪制指南(全彩)
- 軟硬件綜合系統軟件需求建模及可靠性綜合試驗、分析、評價技術
- Wearable:Tech Projects with the Raspberry Pi Zero
- 你好!Python
- Raspberry Pi開發實戰
- INSTANT Lift Web Applications How-to