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

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:

  1. Create a new project folder called Breakout on your desktop.
  2. In your preferred text editor, create a new file called build.settings and save it in your project folder.
  3. Type in the following lines:
    settings =
    {
      orientation =
      {
        default = "landscapeRight",
        supported = { "landscapeLeft", "landscapeRight" },
      }
    }
  4. 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.

主站蜘蛛池模板: 望城县| 潢川县| 建瓯市| 镇沅| 天祝| 驻马店市| 汝阳县| 黄石市| 五常市| 和林格尔县| 临沧市| 晋宁县| 江陵县| 霸州市| 独山县| 玉山县| 额济纳旗| 延庆县| 昌乐县| 通辽市| 新建县| 法库县| 天水市| 康定县| 西丰县| 上饶县| 米易县| 台东市| 衡山县| 车险| 新干县| 惠来县| 昌图县| 扶余县| 龙州县| 营口市| 新巴尔虎左旗| 通山县| 鹤庆县| 海晏县| 墨江|