- 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.
- Apache Spark 2.x Machine Learning Cookbook
- Offer來了:Java面試核心知識點精講(原理篇)
- 程序員考試案例梳理、真題透解與強化訓(xùn)練
- Instant Typeahead.js
- 單片機應(yīng)用技術(shù)
- 快速念咒:MySQL入門指南與進階實戰(zhàn)
- Windows Server 2016 Automation with PowerShell Cookbook(Second Edition)
- 飛槳PaddlePaddle深度學(xué)習(xí)實戰(zhàn)
- Python算法從菜鳥到達人
- Learning OpenStack Networking(Neutron)
- UML 基礎(chǔ)與 Rose 建模案例(第3版)
- ExtJS高級程序設(shè)計
- 基于Struts、Hibernate、Spring架構(gòu)的Web應(yīng)用開發(fā)
- 劍指大數(shù)據(jù):企業(yè)級數(shù)據(jù)倉庫項目實戰(zhàn)(在線教育版)
- 微信小程序開發(fā)與實戰(zhàn)(微課版)