Creating a new main stack

One of the most fundamental tasks in LiveCode is to create a new main stack. Every LiveCode app has a main stack, at least one card, objects, and code. In this recipe, you will learn the steps required to create a new main stack.

How to do it...

To create a new main stack, follow these steps:

  1. Open LiveCode.
  2. From the pull-down menu, select File, and then select New Main Stack.
  3. You now have a new main stack that you can start using for your mobile app. The next step is to set the stack's size properties to match the mobile environment your app will support. Using the property inspector, select Size & Position, and make the necessary adjustments based on the following table:

How it works...

Setting the height and width via the Size & Position section of the property inspector establishes the size boundaries of your mobile app. By swapping the height and width values, you can designate landscape or portrait orientation.

There's more...

Mobile device screen resolutions are subject to change with new devices, so it is important that you check what resolutions your target device supports. This information is usually available via the Apple and Android development sites.