Andreas Rozek  

Welcome Corona - a somewhat different "Hello World!"

iPhone showing the "Welcome Corona!" exampleUsing the Corona SDK [1] it is now possible to develop iPhone applications in Lua [2] rather than Objective-C. As the classical "Hello World!" application, which many people choose to start using a new programming language or development environment, is neither adequate for the iPhone device nor the SDK, this page presents a slightly more difficult (but hopefully much more impressive!) "alternative" to that program...

The Lua source code and any other material which is provided through this page may be downloaded for all supported platforms and used freely in (commercial as well as non-commercial) projects - the software is published under the "MIT License" [3] with the additional restriction that any modifications to the author's original versions must be clearly marked in a way that the original author will never be considered as the author of these modifications!

A final remark: although the presentation may look like an "advertising trailer" for the Corona environment, it should be emphasized that the author is in no way related to Ansca Mobile (except being a user of their Corona SDK) and does not receive any kind of gratification for publishing this example!

Overview

The following topics are currently available, just click on a heading in order to move directly to the associated section:

Description - what this is all about

Amongst other things, the Corona SDK also offers powerful animation functions. Together with some Lua features (tables and functions as first class values) it makes it really simple to develop a series of consecutive animations.

Now, the "Welcome Corona!" example is nothing but such a sequence of animations, precisely timed to fit to the well-known introduction theme from "Thus spoke Zarathustra" (by Richard Strauß) which is running in the background.

The example is not foreseen to be distributed through the iPhone App Store - one reason for this is that it uses material which might be protected by copyright. However, you may definitely download the source code (which is free) and any additionally required material and build the example for your personal use.

Requirements

In order to be able to build the example you will have to satisfy the following requirements:

  • first of all, you will need the Corona SDK [1] (either the trial version or the full one),
  • the SDK runs under Mac OS X 10.5.6 or newer,
  • for the Simulator, a PPC Macintosh is sufficient, but
  • you will need an Intel Macintosh if you want to build for an iPhone,
  • and the iPhone has to run iPhone OS 3 or newer

Building Instructions

Assuming that you have already installed the latest Corona SDK on your Macintosh computer, just follow the instructions shown below to build the example:

  1. create a new folder called "Welcome Corona!" somewhere on your computer
  2. download the source code (named "main.lua") into that folder
  3. download the file "Default.png" as well (into the same folder)
  4. use the "Finder" to navigate into any folder within the Corona distribution, which contains some sample code. From there, copy the file "Icon.png" into your "Welcome Corona!" folder
  5. duplicate the file "Icon.png" and rename the duplicate to "Corona.png"
  6. take your browser and visit the page http://lua-users.org/wiki/LuaLogo. From there, download the largest Lua logo into your "Welcome Corona!" folder and rename it to "Lua.png" (just for the records: yes it was me who generated that file)
  7. visit the page http://strauss-also-sprach-zarathustra-mp3-download.kohit.net/_/26687 and download the Zarathustra theme into your "Welcome Corona!" folder (the full URL is http://www.2112.net/sphere/virtualsongs/audio/Strauss%20-%20Also%20Sprach%20 Zarathustra.mp3, the MP3 file claims to be free). Rename the MP3 file to "Zarathustra.mp3"
  8. download the file "iPad.png" into the "Welcome Corona!" folder

The last file (iPad.png) simply shows an iPad. The author took a larger image  (provided by Apple Inc., it can be found at http://images.apple.com/euro/ipad/gallery/images/hardware-01-20100127.jpg) and manually isolated a single iPad from it - hopefully this operation will already be sufficient to avoid any copyright problems...

Finally,

  1. start the Corona Simulator and open the "Welcome Corona!" folder

If everything went well, you should now briefly see the "Default.png" image before the actual presentation starts. At the end, you will be offered the choice to see the animation again or finish the program.

Downloads

The following files are available and may be freely downloaded onto your own computer:

  • main.lua - the actual source code
  • Default.png - a "splash screen" shown while an iPhone application is loading
  • iPad.png - simply shows a single Apple iPad

References

[1]
Ansca Mobile | Unlock your imagination with Corona
(see http://www.anscamobile.com/)

Using the Corona SDK it is possible to develop iPhone applications in Lua rather than in Objective-C. Follow the link to find out more...

[2]
The Programming Language Lua
(see http://www.lua.org)

Lua is an extremely simple programming language which gains its expressiveness and power from the combination of a few carefully chosen "meta-mechanisms". Follow the link to learn more about this extraordinary language!

[3]
Open Source Initiative OSI - The MIT License
(see http://www.opensource.org/licenses/mit-license.php)

The MIT license (which is sometimes also called "X11 license") is an extremely simple license which basically guarantees free use of software while, at the same time, idemnifying the author from any liabilities.


http://www.Rozek.de/iPhone/Welcome_en.html Last modified: 16.02.2010