Book Image

Corona SDK Mobile Game Development: Beginner's Guide

By : Michelle M Fernandez
Book Image

Corona SDK Mobile Game Development: Beginner's Guide

By: Michelle M Fernandez

Overview of this book

Table of Contents (19 chapters)
Corona SDK Mobile Game Development Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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...