官术网_书友最值得收藏!

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:

  1. In your text editor, create a new file called config.lua and save it to your project folder.
  2. Type in the following lines:
    application =
    {
      content =
      {
        width = 320,
        height = 480, 
        scale = "letterbox",
        fps = 60,
      },
    }
  3. 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.

主站蜘蛛池模板: 镇原县| 甘泉县| 高安市| 石景山区| 长葛市| 偏关县| 玉林市| 巴东县| 呼伦贝尔市| 罗定市| 宣威市| 将乐县| 哈尔滨市| 闻喜县| 德昌县| 于都县| 丹凤县| 石门县| 裕民县| 宿州市| 南郑县| 林口县| 义马市| 大名县| 邹城市| 富宁县| 长治市| 保康县| 日喀则市| 介休市| 大同市| 光山县| 红原县| 九台市| 泗水县| 虞城县| 广东省| 江口县| 屏山县| 璧山县| 综艺|