Custom Devices with Corona Simulator (Windows)

As far as I can tell, as of public build 2014.2381, the Windows simulator in Corona doesn’t have built-in support for defining custom devices and resolutions. That is, at least, there’s no front-end GUI for doing so within the simulator itself.

However, the good news is that it does support custom devices — you’ll just have to define them manually. We won’t bother with creating frames and such in this article, just defining the resolution for a “bare” device.

Of course this is all undocumented, unsupported, whatever.. YMMV.

First, make sure Corona isn’t currently running. We’re going to add/modify some files that appear to only be read during startup.

Navigate to your Corona install directory (probably something like C:\Program Files (x86)\Corona Labs\Corona SDK), then into the Resources folder, then into the Skins folder. There you will find all the various device specifications.

You should also find one named “CustomDevice.lua.template”. You can use this as a starting point, or make a copy of some other one. Typically, you’d want to start with whatever is already “closest” to the device you intend to describe.

So, make a copy and name it something appropriate. (note that on Windows you may need to have administrator rights to create/modify files in this directory)

Next, edit the file to describe your intended device. Most of the properties will probably be self-evident. Obviously, the main ones of interest for our purposes here are “screenWidth” and “screenHeight”, so set those appropriately. Remove any reference to “deviceImage” (or any other .png files specified) as you won’t be using one. “screenOriginX” and “screenOriginY” should both be 0 (since there is no offset into the non-existent frame image).

Here’s a sample of one I made for a Nexus 7 (2012) with it’s available 800×1205 resolution in Portrait orientation (where soft menu bar occupies 75px):

Your new device should show up in the list next time the simulator is launched. That ought to at least get you started. Have fun!

Leave a Reply