Creating Projects

Assets (Building Blocks)

An app consists of several building blocks also known as the assets of the application:

  • Source code: all code is written in the Lua scripting language. Most of the standard Lua library APIs are available for your use. In addition there are APIs offered by Ansca that allow you to quickly and easily create graphically rich and interactive applications. Your main Lua application code is executed from a file called main.lua, but additional code may be placed in external Lua code files.
  • Non-code assets: usually these are multimedia assets such as image (e.g. PNG or JPEG) files, sound files, and video files that are referenced in your application code. You are free to use your favorite creative tools to create these assets.

Starting a Project

Creating projects is really simple. All you do is create an empty folder in which to put all asset files used by your application. This includes any external library files that you wish to reference from your main application file, main.lua .

It is important that you only put files that your application actually uses. You should not put older versions of your main.lua file or older versions of your multimedia assets. Also, you should only place final production assets in this folder; you should not place the original native files produced by creative tools like Photoshop® (PSD) or Illustrator® (AI).

If you were to create a project called "MyProject", the directory structure would look like:

MyProject/
                Icon.png
                logo.png
                main.lua
                library.lua
                library2.lua
                photo.jpg
                ...

Notice that the code and non-code assets (e.g. images) are in the same directory. There’s also an icon image that lives alongside all the assets. This icon file should be a PNG that’s 57x57 pixels.

Note: Files that start with a . (period) are excluded from the application bundle during the build process and will not be included in the final application

For instructions on how to create your own external code libraries, see the Module section of the Api Reference. Additionally, for example code that loads optional Corona libraries, see the projects ButtonEvents and Movieclip in the Sample Code directory of the Corona SDK.


Building for Xcode Simulator

To build for iPhone/iPad, select "Device". To build/launch in the Xcode simulator, select "Xcode Simulator".

Building for Device

Building your app for device is covered in the following chapters:

Replies

Viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jonlame
User offline. Last seen 1 year 16 weeks ago. Offline
Joined: 26 Jan 2011

huh?

bigman8640
User offline. Last seen 1 year 7 weeks ago. Offline
Joined: 28 Jan 2011

Another newbie like me trying to bump through this also? I am using Windows but since more info is set up for MAC I may get a desk top to do this. I am looking to find someone to bump around and figure this out. I will be renting books also.

cheeseburgers
User offline. Last seen 33 weeks 1 day ago. Offline
Joined: 29 Jan 2011

I am so mad at corona! all I see is an iphone with cubes all around and 4 buttons near the top.

bigman8640
User offline. Last seen 1 year 7 weeks ago. Offline
Joined: 28 Jan 2011

Are you kidding. I was working with the new windows beta and it is ticking me off, then to find out it will not do the I/stuff which is why I wanted it. I have a friend that will GIVE me what was the top of the line G5, but it will not support OS X 10.6, so here I am stuck again.

danielbrno
User offline. Last seen 35 weeks 4 days ago. Offline
Joined: 29 Dec 2010

Hi,

I cannot build for iOS, Android or Xcode simulator. Is this a problem? Or in the trial version isn't permitted?

Thanks in advance.

d0mokun
User offline. Last seen 45 weeks 5 days ago. Offline
Joined: 18 Jan 2011

EDIT- building under the trial version is supported, but only for your device. In order to do a 'proper' iOS build for deployment, Corona needs to be licensed.

pigeon_lance
User offline. Last seen 1 year 11 weeks ago. Offline
Joined: 2 Mar 2011

looking for a lua programmer ; see our list at htt://www.skillarmy.com chat in rt

hawkfire4
User offline. Last seen 1 year 10 weeks ago. Offline
Joined: 2 Mar 2011

bigman8460 If you wish to use MAC OS X 10.6 and have Windows use VMWARE.

bigman8640
User offline. Last seen 1 year 7 weeks ago. Offline
Joined: 28 Jan 2011

hawkfire4 Thanks a bunch! I had quite coming in since it was driving me nuts. I broke down and purchased a macbook pro. Now I have the tools I need I just have to learn how to use everything. It is not that hard but definitely different.

supercabb
User offline. Last seen 50 weeks 5 days ago. Offline
Joined: 28 Apr 2011

How install TextWrangler_3.5.3.dmg in Windows XP? It's possible?

Thanks for advance!

d0mokun
User offline. Last seen 45 weeks 5 days ago. Offline
Joined: 18 Jan 2011

Hi supercabb,

You won't be able to install any *.dmg file in Windows natively. A *.dmg file is for the Mac environment.

Instead you'll need to download and install a similar programme such as Notepad++ . A good list can be found here:
http://alternativeto.net/software/textwrangler/?platform=windows

Best regards
Dan.

anujmnitjpr
User offline. Last seen 1 year 3 days ago. Offline
Joined: 20 May 2011

Is there any example project available to start with. ?

steve.primarolo
User offline. Last seen 51 weeks 3 days ago. Offline
Joined: 28 May 2011

You don't seem to have included any instructions on what software to use to create Main.lua. I'm not that familiar with Mac's, but have got hold of one to develop apps for an ipod touch. The only text editor that I can find only lets me save with set file suffixes, e.g. rtf. Finder will let me rename the file, but not change the suffix from rtf to lua. You might at least provide a source creation and editing suite. Any clues anyone?

jkstolzenbach
User offline. Last seen 51 weeks 1 day ago. Offline
Joined: 14 May 2011

And I quote:

"You only need two things to get started with Corona:

A copy of Corona
Any text editor
Many people already have a favorite text editor, but if you don't, we recommend starting with TextWrangler, which is free and can be downloaded here.

You could also use the TextEdit utility that's included with your Mac, but you'll find that it's easier to work with a text editor designed for programming, so try TextWrangler if you don't have a personal favorite.

Later on, you'll need to install Apple's developer kit to test on your iPhone or iPad, or ship your app to the App Store, but you can get started with Corona in the meantime."

http://www.barebones.com/products/textwrangler/download.html

clive3
User offline. Last seen 42 weeks 1 day ago. Offline
Joined: 1 Aug 2011

what a terrible bit of software.
txt editor to create your app, crazy when xcode has everything included, screen editors etc

webberm
User offline. Last seen 15 weeks 23 hours ago. Offline
Joined: 8 Mar 2011

LOL, wow you just don't get what Corona SDK is do you??!

saadlulu
User offline. Last seen 9 weeks 3 days ago. Offline
Joined: 7 Sep 2011

Am pretty sure this dude don't know what corona is, Cuz the only thing corona is missing is the Text editor.