Share Your Code

Most Viewed

Most viewed sample code and code libraries shared by developers for Corona SDK.

63 votes
Director Class

Hello everybody! I'm so pleased to share with you my Director class for control scenes with or without transitions! Version 1.4 New BOOKS, check this out! More...

Posted by ricardorauber, Posted on 6 Oct 2010, Last updated 26 Aug 2011 | 174 comments

12 votes
BeebeGames Class

*Requires Corona Build 243 at the very least. Download it here: beebegames1-8.zip VERSION 1.8 - Released January 16, 2011 What's new in this (and previous) version? 1.8 - Fixed major memory leak issues in regards to the destroy() function for objects and cancel() for timers. Also, randomTable functions have been deprecated because after extensive testing, localizing math.random actually works A LOT faster than using... More...

Posted by jonbeebe, Posted on 14 Dec 2010, Last updated 16 Jan 2011 | 70 comments

6 votes
Corona Comics

Have a comic book? Want to publish it on a mobile device like the big players Marvel, DC, and Vertigo? There was not an easy way for the small independent artists to publish on mobile devices, until now. More...

Posted by Seabats, Posted on 23 Jul 2010, Last updated 11 Nov 2011 | 51 comments

16 votes
Ghosts vs. Monsters

A sample game very similar to Angry Birds. It is Ghosts vs. Monsters, done in Corona SDK. Two levels to play with and for you to see how easy it is do do a similar game using the Corona SDK. Sample took less than 36 hours to code, with music and graphics. Special thanks to Jonathan and Biffy Beebe for creating the game exclusively for us and for you to enjoy. Read more about it on our blog. More...

Posted by carlos m. icaza, Posted on 9 Dec 2010, Last updated 18 Oct 2011 | 41 comments

13 votes
Table View Library

This library will allow you to create table views. Tables have rows of items and can scroll up and down. Download: http://bitbucket.org/gilbert/table-view-library/src Source files include tableView.lua, ui.lua, main.lua and png graphics. Source files include an assets folder with graphic source files. Graphic source files can be used to create custom backgrounds and buttons. More...

Posted by Gilbert, Posted on 16 Jul 2010, Last updated 30 Mar 2011 | 82 comments

4 votes
Tab Bar

Create a tab bar that will allow you to switch screens within your app. More...

Posted by Gilbert, Posted on 8 Sep 2010, Last updated 19 Oct 2010 | 28 comments

12 votes
Object-Oriented Sample Game Framework

I put together a basic game framework to show novice programmers how to organize your code in a modular, object-oriented way. You can download the project from here: http://www.box.net/shared/uz5beg19h8 I wouldn't necessarily recommend starting here if you are totally new to programming, but if you have a little previous familiarity with object-oriented programming then this is a good head-start in using Corona. I... More...

Posted by jhocking, Posted on 20 Jan 2011, Last updated 11 May 2011 | 31 comments

10 votes
Scroll Content

This code can be used to make a screen scroll when the user touches a display group and moves it up or down. It responds to the user's velocity, so if he or she flicks it up or down really fast it'll move up or down fast. More...

Posted by Gilbert, Posted on 14 Jul 2010, Last updated 11 May 2011 | 54 comments

46 votes
SpriteGrabber --SpriteSheets in two lines

SpriteGrabber is the easy way to use spritesheets in Corona for including animated and stationary graphics in your project. With SpriteGrabber you need to write significantly less code compared to directly calling the SDK functions. Moreover, you don't have to remember the index numbers for the frames of your sprites, since SpriteGrabber calls sprites using their image-names. Technically, SpriteGrabber is a helper... More...

Posted by Magenda, Posted on 29 Oct 2010, Last updated 6 Apr 2011 | 157 comments

7 votes
Martian Control

Another example game very simliar to Flight Control done using Corona SDK. If you have played Flight Control, this is very simliar game. The code is now open source so you can see how easy it is to recreate using Corona. Once again, especial thanks to Jonathan and Biffy Beebe from Beebe Games for helping us showcase the power of Corona. This sample game took almost 30 hours to do, including imaging, sound, etc.... More...

Posted by carlos m. icaza, Posted on 13 Dec 2010, Last updated 18 Oct 2011 | 8 comments

14 votes
Joystick

Add a joystick to your game, add multiple joysticks if necessary. More...

Posted by Matthew Pringle, Posted on 18 Aug 2010, Last updated 7 Oct 2010 | 30 comments

2 votes
UI Library

This is the updated ui.lua file to work with Dynamic Scaling. It's based on the 1.5, so the latest version. More...

Posted by Alwayk, Posted on 13 Sep 2010, Last updated 7 Oct 2010 | 30 comments

20 votes
Multiplayer Networking and Push Notifications

Corona Multiplayer Networking and Push Notifications API for Mobile Apps and Games Enable Networking with your Mobile Apps with 3 functions. Networking your apps allows you to implement multiplayer games and more! Implement push notifications between phones, tablets, laptops and web servers. Everything can send and receive data from everywhere on Earth. Init PubNub Multiplayer Object Call Subscribe() to begin... More...

Posted by blum.stephen@gm..., Posted on 28 Jan 2011, Last updated 6 Jan 2012 | 157 comments

3 votes
Game Template

The code can be downloaded here: https://github.com/radamanthus/corona-game-template USAGE Out of the box, this is a working Corona project. It includes a splash screen (loadmenu.lua, displays images/splashScreen.png for 1 second) and the following menu buttons: - Play - Settings - Help - About The images for the buttons are loaded from images/buttons. Note the naming convetion: play.png is the button for Play,... More...

Posted by radamanthus, Posted on 1 Jan 2011, Last updated 1 Jan 2011 | 8 comments

4 votes
Open Source Weather app example: Asynchronous and Synchronous

I've created an example open source weather application using a zip code. Here's the link to the sample code: 1. Synchronous: http://www.digitalblur.com/downloads/corona/weather_demo.zip 2. Asynchronous: http://www.digitalblur.com/downloads/corona/weather_async_demo.zip And here's an overview on how it works: 1. On launch, the app will automatically make a call to the API at http://api.wunderground.com passing a... More...

Posted by digitalblur, Posted on 16 Jan 2011, Last updated 1 Feb 2011 | 21 comments

3 votes
How to use XCode with Corona

Here's how to use XCode as the default editor for Corona and use Syntax Highlighting. This has been collated with information available on the forums. UPDATED: The document can be found here http://files.oz-apps.com/XCodeAsEditor.pdf and the http://files.oz-apps.com/Lua.xclangspec file Hope that you find it useful. If you make changes to any or find some new ways, please update the document, the Corona... More...

Posted by JayantV, Posted on 28 Nov 2010, Last updated 11 Oct 2011 | 29 comments

4 votes
Parallax scrolling module

A basic parallax scrolling demo, for scrolling around a "world" via dragging the mouse (or via multi-touch if you configure this module for use on your device!). Supports: unlimited parallax layers (within performance limits, obviously) variation of parallax scrolling rates, to adjust visual "distances" ability to build sub-layers within the core parallax layers adjustable "world limits" for the user to scroll... More...

Posted by Ignis Design, Posted on 7 Nov 2010, Last updated 7 Nov 2010 | 7 comments

9 votes
Save and Restore State

This sample code shows how to save values to a data file and use them to restore the state of an object when the app runs again. More...

Posted by Gilbert, Posted on 20 Jul 2010, Last updated 7 Oct 2010 | 6 comments

2 votes
Display Objects and Texture Memory

This tutorial code is used to demonstrate Display Objects and their affects on Texture Memory. You can view a two part video of this tutorial at: http://www.youtube.com/watch?v=_oWWWueFl8I More...

Posted by Tom, Posted on 5 Oct 2010, Last updated 7 Oct 2010 | 2 comments

5 votes
Post JSON data and receive JSON data example

Sample code for posting and fetching JSON data over http. More...

Posted by ehsmeng, Posted on 5 Jun 2010, Last updated 7 Oct 2010 | 6 comments

6 votes
Useful functions for Tables and Arrays

This module includes 5 very useful methods for working with Tables and Arrays: 1 2 3 4 5 keys(table) -- Returns the keys from the table values(table) -- Returns the values from the table include(table, value) -- Checks if the given value is included in the table select(table, expression) -- Selects values from the table by the given expression reject(table, expression) --... More...

Posted by tjackiw, Posted on 18 Oct 2010, Last updated 21 Oct 2010 | 5 comments

14 votes
More Easing!

An extended easing library with in and out versions of bounce, elastic and standard ease. More...

Posted by scarnie, Posted on 23 Aug 2010, Last updated 7 Oct 2010 | 8 comments

1 vote
Simple Slide View

I wrote this as I needed a horizontally (in landscape) simple scrollable list of images. The user could then scroll left/right and tap to select. I needed this to appear in a window (i.e. not full screen). Note, this is something I wrote in a few hours and it's very specific to my requirements. However, it should be reusable and certainly could be improved on I'm sure (not being doing Corona for long). Here's a... More...

Posted by thegwill, Posted on 31 Oct 2010, Last updated 31 Oct 2010 | 4 comments

3 votes
Slide Viewer

This view for images and photos allows the user to swipe from side to side to view each of the images. The nav bar fades out when the user is sliding or taps an image. Similar to the iPhone "Photos" app. More...

Posted by Gilbert, Posted on 18 Aug 2010, Last updated 18 Oct 2011 | 40 comments

1 vote
Break Out Game

At a training seminar we setup once, we went through and build a break out game from scratch. Evan Kirchhoff, our sr. engineer put it together and we are uploading it for you to see how easy it is to do a full game in a few lines using Corona. Bricky There are six folders that build up to to the final game play. Carlos More...

Posted by carlos m. icaza, Posted on 15 Oct 2010, Last updated 15 Oct 2010 | 6 comments

1 vote
Corona Game Template by Ziray Studio Labs

The template includes example code for: Display groups Orientation and accelerometer Touch with buttons File reading Example level file for scripting game play The template separates functionality into modules for an object oriented approach. http://www.mikeziray.com/2010/06/27/corona-game-template-in-lua/ If you find the template useful, please consider buying a copy of our current application to support us. It’d... More...

Posted by Eric, Posted on 15 Oct 2010, Last updated 18 Oct 2011 | 1 comments

9 votes
Slider module (springboard functionality), warning: shameless promotion inside

Hi all, Here is a simple but powerful Slider (springboard) module I've created for my recent iPhone game (Fingerless 3D). This module enables you to create "slides" which the user can slide / swipe between. Features: 1. Each slide is a display group, which enables it to contain any other display objects (text, buttons etc.) 2. Ability to add "control buttons" which indicates which is the current slide and enables... More...

Posted by ez123, Posted on 19 Jan 2011, Last updated 19 Jan 2011 | 32 comments

3 votes
Sprite Extended

This code snippet is a reworked movieclip module to use sprite sheets instead of individual pngs for generally better performance. It provides all the same features as movieclip. More...

Posted by scarnie, Posted on 13 Aug 2010, Last updated 7 Oct 2010 | 4 comments

13 votes
Output FPS and texture memory usage in your app

A small widget that outputs the current fps, the minimum fps during the last 30 frames and the current texture memory usage. Change the value of maxSavedFps to some other value to get the minimum FPS during a different amount of frames. 1 2 3 4 5 6 7 8 9 10 11 12 13 module(..., package.seeall) PerformanceOutput = {}; PerformanceOutput.mt = {}; PerformanceOutput.mt.__index =... More...

Posted by Wizem, Posted on 21 Oct 2010, Last updated 21 Oct 2010 | 28 comments

1 vote
Screen Scroll

The code will make a screen, consisting of images, scroll in the vertical direction. It is based on Gilbert's Scroll Content original post http://developer.anscamobile.com/code/scroll-content More...

Posted by tetu, Posted on 13 Sep 2010, Last updated 7 Oct 2010 | 7 comments

7 votes
Wrap Text

Use this function to wrap long bodies of text. Supports paragraphs. More...

Posted by Gilbert, Posted on 14 Jul 2010, Last updated 14 Jul 2010 | 31 comments

2 votes
Samurai Kitchen

We were special guest at the 2009 Adobe Max Russel Brown's Photoshop Pre Conference-Conference and we wrote a game during the session where the attendees could swap in their images for the images in this game. I am uploading the zip file and hopefully it is self explanatory and you can see how easy it is to create games and do animations in just a few lines of code. Samurai Kitchen Carlos More...

Posted by carlos m. icaza, Posted on 15 Oct 2010, Last updated 18 Oct 2011 | 12 comments

4 votes
Tables in Lua: Dictionaries AND Arrays

Most people understand how to use Lua tables like arrays in other programming languages. However, Lua tables can also be used like dictionaries (aka hash tables, aka associative arrays) which is a very powerful concept. More...

Posted by jhocking, Posted on 23 Jan 2011, Last updated 28 Jan 2011 | 5 comments

1 vote
2 Circling Balls - Corona physics example of body:applyForce()

The example uses the physics engine, sets gravity to 0, creates two balls separated in the x-direction, with initial speeds in opposite y-direction. More...

Posted by FrankS, Posted on 25 Sep 2010, Last updated 7 Oct 2010 | 1 comments

5 votes
SoundTextSync - Read-it-to-me Story Books and interactive text

Inspired by interactive story books for kids, like Broderbund's old Living Book titles from the 1990s. When the narrator reads the text, the words light up or are highlighted as they are spoken. After the narrator finishes reading, you can tap on any word and hear that word spoken. More...

Posted by DavidBFox, Posted on 22 Nov 2010, Last updated 22 Nov 2010 | 29 comments

5 votes
Bezier Curves in Corona

Finally ! Bezier segment manipulation using Corona SDK. This is a sample of how to manipulate a cubic bezier segment. Touch the screen to draw the four points (anchor1,handle1,handle2,anchor2) then manipulate the curve. I cleaned up the code as much as I could. It is not optimized. Feel free to make changes, amplifications and updates and share with the rest of us. You can download the code at Bezier Code I tried it... More...

Posted by carlos m. icaza, Posted on 11 Dec 2010, Last updated 11 Dec 2010 | 19 comments

4 votes
Another local score framework

A local score framework. More...

Posted by MikeHart, Posted on 15 May 2010, Last updated 7 Oct 2010 | 27 comments

1 vote
Slide Viewer for user-defined screens

This is a combination of the Tab Bar and Slide Viewer samples posted by Gilbert. The TabBar samples lets you switch between different "screens" defined in external Lua files (screen1.lua, screen2.lua, etc.), and Slide Viewer lets you swipe left/right between different images . This modification lets you slide between different user-defined screens, rather than images. Download More...

Posted by Tim, Posted on 27 Oct 2010, Last updated 27 Oct 2010 | 8 comments

5 votes
Slider

[EDIT: note, as of build 2011.591, on iOS this code is now superseded by the built-in Widget library. Android: please stay tuned] Developed at TechCrunch Hackathon SF 2010, this is a slider component (based loosely on the Button component in ui.lua) that sets a number value based on the position of the thumb in a slider track. We'll clean it up and add features, but wanted to share it as is. More...

Posted by Eric, Posted on 26 Sep 2010, Last updated 2 Aug 2011 | 9 comments

2 votes
Read an RSS feed into a Lua table

Download an RSS feed into a table for later parsing: More...

Posted by d3mac123, Posted on 2 Jun 2010, Last updated 7 Oct 2010 | 8 comments

1 vote
corona-async-http

Currently (November 3, 2010), the Corona SDK only support synchronous http requests, meaning your app blocks while the http request is in flight. Even sound playback comes to a grinding halt. While we wait for Corona to officially support async http, I have created a workaround based on webpopups and AJAX. Usage is as follows: 1 2 3 4 5 6 7 8 local async_http = require("async_http")   local... More...

Posted by m9415253, Posted on 3 Nov 2010, Last updated 3 Nov 2010 | 21 comments

2 votes
D-Pad Demo

This is a demo for controlling a object with a D-Pad. -Gamexcb http://www.mediafire.com/?2jg2ep54ay9ee1t More...

Posted by Gamexcb, Posted on 20 Oct 2010, Last updated 20 Oct 2010 | 1 comments

1 vote
Table View Sample V0.13

Sample code to use TableViewLib.lua in CORONA SDK More...

Posted by carlos m. icaza, Posted on 11 Aug 2010, Last updated 7 Oct 2010 | 3 comments

2 votes
Track Velocity

This code sample creates a circle that bounces off the edges of the screen. You can touch the circle and throw it around. It tracks velocity. When the user touches the circle and starts moving it, the change in distance over time is captured and given to the circle as it's new speed when the user lets go. More...

Posted by Gilbert, Posted on 3 Aug 2010, Last updated 7 Oct 2010 | 3 comments

3 votes
Color to RGB value table for Lua coding with Corona

A look up function for converting basic colors to RGB values. More...

Posted by FrankS, Posted on 20 Sep 2010, Last updated 7 Oct 2010 | 1 comments

1 vote
Toggle

Developed at TechCrunch Hackathon SF 2010, this is a toggle component (based loosely on the Button component in ui.lua) that sets a value based on the state of the toggle. We'll clean it up and add features, but wanted to share it as is. More...

Posted by Eric, Posted on 26 Sep 2010, Last updated 7 Oct 2010 | 10 comments

2 votes
Execution Order - An example to experience non-linear, sequential program flow

1 2 3 4 5 6 7 8 9 10 11 -- An example to experience non-linear, sequential program flow -- as event based, using transition onComplete statements -- and adding, listening for and removing Events -- -- In Corona, you may need to wait for some code to complete, -- in order for your program to flow in a prescribed sequence. -- Code with visuals such as transitions needs to send up a flare -- when its done, done here... More...

Posted by alangrus, Posted on 12 Oct 2010, Last updated 12 Oct 2010 | 0 comments

5 votes
Rope Demo

This is a demo of a rope with a ball attached at the end bouncing when you touch the ball. See Rope Video This is code is as is. You can use it to your hearts content. It may have some bugs. Enjoy. Download it here Rope.zip You can create your own effect and see if you can cut the rope. Open Source. Carlos More...

Posted by carlos m. icaza, Posted on 18 Feb 2011, Last updated 18 Feb 2011 | 14 comments

3 votes
Image Viewer

This image view library contains a slide viewer that allows the user to load a series of photos and flick them from left to right. More...

Posted by Gilbert, Posted on 16 Jul 2010, Last updated 7 Oct 2010 | 1 comments

12 votes
Flash's hitTestObject() emulated using contentBounds

You call this function with two images. It returns true if the images are overlapping, and false if they aren't. This is pretty handy for basic collision detection without using physics. 1 2 3 4 5 6 function hitTestObjects(obj1, obj2)         return obj1.contentBounds.xMin < obj2.contentBounds.xMax                 and obj1.contentBounds.xMax... More...

Posted by jhocking, Posted on 20 Jan 2011, Last updated 22 Mar 2012 | 15 comments

6 votes
Carousel - simulating depth in Corona

A technique to make 2D objects appear to move around in 3D space. -- Carousel animation demo. -- Mark H Carolan 2010 -- Simulate depth in 2D on Corona platform.   local nImages = 8 local range = 360 local sectionSize = range / nImages local xCentre = display.contentWidth / 2 local yCentre = display.contentHeight / 2 local diameter = display.contentWidth - xCentre/2 local r = diameter / 2 local points = {... More...

Posted by MarkHenryC, Posted on 8 Feb 2011, Last updated 23 Aug 2011 | 4 comments

4 votes
Check for Internet Connection

Check for an internet connection if your app requires one. I use this at app-launch and show the exit button to close the application if no net connection exists. More...

Posted by LiveToCollect, Posted on 15 Aug 2010, Last updated 7 Oct 2010 | 10 comments

2 votes
3D Clock

This is 3D Clock sample. Code is exported from AS3 to corona. More...

Posted by muxukeikei, Posted on 21 Jul 2010, Last updated 7 Oct 2010 | 0 comments

7 votes
OAuth Library

This is OAuth Library for Corona. download link is http://bit.ly/corona-oauth **Update** version 2.0 Release note ・async http request support(network library) ・test using twitter oauth system ・fix some bugs (only sync http request version for android is preparing now.) main.lua for test tweet http://bit.ly/corona-oauth-main (this main.lua has some bug. (e.g. error handling) ) (can not use simulator. xcode simulator... More...

Posted by muxukeikei, Posted on 3 Nov 2010, Last updated 21 Mar 2011 | 32 comments

3 votes
Multiline text with width in pixel

I have written a function for wrapping text with a variable width in pixel. I've taken the code of Gilbert for wrapping after a number of characters and used some parts of it. Here is my Version: More...

Posted by Cromax, Posted on 7 Aug 2010, Last updated 7 Oct 2010 | 15 comments

1 vote
TweakScene

After hours of changing variables and building each time to balance my game. I decided to create a tweakscene. You can use this to change the values of some of your game variables while you play. This allows you to change them, play the game and take notes where they should be for perfect gameplay. More...

Posted by amigoni, Posted on 8 Nov 2010, Last updated 8 Nov 2010 | 0 comments

6 votes
explode function

This function is intended to work just like PHP's explode function. It's handy for parsing data. More...

Posted by Gilbert, Posted on 13 Jul 2010, Last updated 16 Jul 2010 | 6 comments

1 vote
Simple local score framework

I wrote a simple and easy to use local high score system for some of my games and I thought I'd share. More...

Posted by Abica, Posted on 2 May 2010, Last updated 7 Oct 2010 | 4 comments

6 votes
Open Source Stock App

I've created an open source stock application using the Corona SDK. Here's the source: http://www.digitalblur.com/downloads/corona/corona_stock_open_source.zip Works very similar to the open source weather app I posted here: http://developer.anscamobile.com/code/weather-app-example How it works: We make a call to the Google stock API, parse the xml, and display the results. We can also enter another stock symbol to... More...

Posted by digitalblur, Posted on 5 Feb 2011, Last updated 5 Feb 2011 | 7 comments

2 votes
Show Native Activity Indicator While Connecting and Downloading

This code demonstrates how to show a native activity indicator while connecting to a remote location and downloading a file. More...

Posted by Gilbert, Posted on 4 Aug 2010, Last updated 7 Oct 2010 | 3 comments

2 votes
Object along a bezier curve's path.

The sample code here demonstrates how to move an object along a bezier path. Tap on the screen four times to generate the anchor and handles. Once the curve is drawn, an object will move along the resulting path. Self explanatory. Click here to download the sample code :Bezier Carlos More...

Posted by carlos m. icaza, Posted on 10 Jan 2011, Last updated 10 Jan 2011 | 8 comments

2 votes
Movie clips and retina display

Wish to use movieclips with retina display? When you use the built in movieclip library it defaultly uses newImage to spawn images... which is fine, but doesn't work with retina displays! Download my movie clip library below to use movieclips with the retina display! THE RETINA DISPLAY SUPPORTED MOVIECLIP LIBRARY HAS BEEN UPDATED! You must go here: http://bit.ly/iTnsF9 to download! Thank you for your support guys! More...

Posted by iGARET, Posted on 19 Jul 2010, Last updated 10 May 2011 | 11 comments

2 votes
Adobe Fireworks to Corona Exporter

Alex Souza was kind enough to share his Fireworks to Corona exporter. More...

Posted by carlos m. icaza, Posted on 11 Aug 2010, Last updated 7 Oct 2010 | 0 comments

7 votes
Billy Cart in Corona

For Corona users getting started with physics this project skeleton may be useful. Items of of interest: Wheel-powered vehicle Auto-generate physics landscapes Vector drawing Custom physics shapes Camera tracking Physics collision callbacks Get the code from github rather than here, as an additional config file is required. ----------------------------------------------------------------------- -- main.lua... More...

Posted by MarkHenryC, Posted on 10 Feb 2011, Last updated 23 Aug 2011 | 10 comments

5 votes
Modified movieclip.lua

Here is a modified movieclip.lua file that will let you set the speed of the animation. To do this, call the setSpeed method with the speed factor. 1.0 means the animation will be updated every frame, 0.5 means every second frame and so on. More...

Posted by MikeHart, Posted on 11 Jun 2010, Last updated 7 Oct 2010 | 3 comments

3 votes
Classic 3d wireframe cube demo

Here is a classic 3d wireframe cube demo. Who said Corona could not render basic 3d ? More...

Posted by Hasufel, Posted on 17 Apr 2010, Last updated 7 Oct 2010 | 1 comments

1 vote
JSON library example code

Sample code for dealing with JSON strings. More...

Posted by dwallin33, Posted on 7 Mar 2010, Last updated 7 Oct 2010 | 1 comments

2 votes
Atlas Generator

Generates a sprite sheet from a list of files in row-major order. More...

Posted by scarnie, Posted on 20 Aug 2010, Last updated 7 Oct 2010 | 0 comments

4 votes
How to use textures to create notion of movement

In the field of computer graphics, due to limited CPU performance, textures are often use to create the notion of movement. Here I upload a simple demo that demonstrate several features of Corona. 1) eventListener 2) sprites 3) alpha channels In this demo, I use an alpha channel trick, plus a random water texture, to make it look as there is water motion. Download sources here: Clownfish.zip See video at Aquarium More...

Posted by carlos m. icaza, Posted on 24 Oct 2010, Last updated 24 Oct 2010 | 3 comments

2 votes
Pause and Restart Animation

If you have programmatic animations, you can pause and restart them. Here’s how you can make a button start and stop an animation. More...

Posted by Gilbert, Posted on 20 Jul 2010, Last updated 7 Oct 2010 | 0 comments

1 vote
Safe OpenFeint wrapper

Provides a safe wrapper for the openfeint module, so you don't have to think about whether it's running on the simulator, device, etc and avoid hangs / crashes. It is currently a subset of the openfeint API, but calls are compatible. More...

Posted by scarnie, Posted on 15 Aug 2010, Last updated 7 Oct 2010 | 5 comments

1 vote
Image Toggle

A way to toggle between 2 images in a display group More...

Posted by alangrus, Posted on 2 Sep 2010, Last updated 7 Oct 2010 | 7 comments

2 votes
Sample code to loop background music synchronized on your apps!

Here is my little trick to loop any sound music file on you app. More...

Posted by fpassa, Posted on 5 May 2010, Last updated 7 Oct 2010 | 0 comments

1 vote
It's snowing and shake example

Digital snow globe. More...

Posted by freshworks, Posted on 10 Dec 2009, Last updated 7 Oct 2010 | 1 comments

4 votes
Sine Wave

This is a great piece of sample code that demonstrates how to use the Sine function to create an animated sine wave. More...

Posted by Gilbert, Posted on 16 Aug 2010, Last updated 18 Nov 2011 | 1 comments

2 votes
Numeric Keypad plugin module - iPad format

A numeric keypad for iPad applications. More...

Posted by alangrus, Posted on 9 Sep 2010, Last updated 7 Oct 2010 | 0 comments

2 votes
Scrolling list

Check out this totally trick scrolling list. More...

Posted by Eric, Posted on 21 Apr 2010, Last updated 7 Oct 2010 | 4 comments

1 vote
Really simple loader example

Simple Pre-Loader indicator. More...

Posted by freshworks, Posted on 4 Dec 2009, Last updated 7 Oct 2010 | 2 comments

1 vote
Generating tag list

There are occasions when you want the list of functions and symbols in Corona. This is a method to easily obtain them. For example, there's a nifty add-on for editors called BBAutoComplete. This adds word autocompletion to many editors. It automatically looks for expansions in the program’s open documents. To use it, you need some useful expansions in a text file. More...

Posted by Eric, Posted on 10 Oct 2010, Last updated 10 Oct 2010 | 3 comments

1 vote
File listing function for Corona's Resource/Documents/Temporary Directories

Notice: This code will ONLY work in the simulator and not on the actual device. The os.execute() function does not run on the device because of security restrictions. Sample code for listing files in the Corona directories in the simulator. More...

Posted by Gilbert, Posted on 25 Sep 2010, Last updated 15 Jun 2011 | 12 comments

2 votes
Universal "Constants" module with very easy usage!

This is my implementation of an very easy to use module to implement constants in Lua (inspired by PIL and another solution which was listed in the forums) More...

Posted by OderWat, Posted on 22 Jul 2010, Last updated 7 Oct 2010 | 0 comments

2 votes
Enable real-time device debugging on iOS

A solution for "real-time" logging while code is running on the device. More...

Posted by OderWat, Posted on 14 Jun 2010, Last updated 7 Oct 2010 | 2 comments

1 vote
Customisable Slider

Though this may be about to become obsolete, this library provides a very configurable slider control. The full download is here: https://files.me.com/horacebury/qowp06 The original forum threads are here: http://developer.anscamobile.com/forum/2010/11/02/window The updated thread: https://developer.anscamobile.com/forum/2011/02/05/updated-slider-library Demo video: http://www.screencast.com/t/QN4qCWip More...

Posted by horacebury, Posted on 14 Feb 2011, Last updated 14 Feb 2011 | 0 comments

2 votes
IMA4 Dropper

A simple sound converter for transforming sounds to CAF. More...

Posted by jonbeebe, Posted on 17 Sep 2010, Last updated 7 Oct 2010 | 7 comments

4 votes
print_r() implementation (dumps everything as human readable text)

This is "dumper" function in the style of "print_r()" from php. More...

Posted by OderWat, Posted on 20 Jul 2010, Last updated 7 Oct 2010 | 2 comments

2 votes
Point Reduction Code

Using a modified version of the Douglas-Puecker algorithm, using a tolerance value, check for the distance between points, rejecting points that don't fit within the tolerance. Depending on the line and tolerance, you may end up with different corner cases, thus a bit jagged line. So use different values for tolerance. look at function polySimplify Click point reduction.zip to download. Carlos More...

Posted by carlos m. icaza, Posted on 26 Feb 2011, Last updated 26 Feb 2011 | 6 comments

2 votes
Simple parallax starfield

Simple starfield More...

Posted by freshworks, Posted on 9 Dec 2009, Last updated 7 Oct 2010 | 3 comments

1 vote
Orientation change with touch coordinate modification

Orientation change sample script. More...

Posted by MikeHart, Posted on 28 Apr 2010, Last updated 7 Oct 2010 | 0 comments

3 votes
Clear Corona Simulator terminal on reload

A technique for clearing the terminal window on every relaunch. More...

Posted by OderWat, Posted on 9 Jun 2010, Last updated 7 Oct 2010 | 8 comments

2 votes
UI.lua Disable Buttons

If a button is removed while it is being pressed the application will crash. By using this very slightly modified UI.lua code you can say ButtonsEnabled = false in your Main.lua and then remove it. More...

Posted by werdinteractive, Posted on 7 Apr 2010, Last updated 7 Oct 2010 | 2 comments

1 vote
Bitwise operators in lua

Bitwise operators in Lua for Corona SDK Download this sample to implement bitwise operators for the Corona SDK. I have tested it with other apps I have done. Is pretty straight forward. There may be a penalty for usage in loops as the implementation is not optimized for inner loops. And you can create nice gradients like this: More...

Posted by carlos m. icaza, Posted on 7 Oct 2010, Last updated 7 Oct 2010 | 1 comments

2 votes
SimpleAudioRecorder

Shows how to use the new audio API to record audio to a file. The user presses a button to record a sound, then again to stop recording and hear it played back. The sampling rate can also be adjusted. More...

Posted by snarla, Posted on 30 Aug 2010, Last updated 7 Oct 2010 | 1 comments

1 vote
Portable Seedable Random Number Generator

Here I present a portable pseudo random number generator based on MD5 Hashes. I am using an interesting way to create the objects very lightweight and encapsulate all of the functionality in a simple to use module. More...

Posted by OderWat, Posted on 20 Jul 2010, Last updated 7 Oct 2010 | 0 comments

4 votes
Playlist for playing multiple songs

A internal mp3 playlist (not for playing songs out of iTunes) More...

Posted by OderWat, Posted on 10 Jul 2010, Last updated 7 Oct 2010 | 0 comments

8 votes
Rosetta

Rosetta is a very simple module that makes it easy to include multiple languages (or just one) in your app or game. Languages are stored in external files which allow your designers/translators to edit them without requiring the help of a programmer. Example usage -- Load Rosetta local rosetta = require("rosetta").new()   -- Initiate Rosetta - this will load all languages and settings... More...

Posted by GrahamRanson, Posted on 4 Jan 2011, Last updated 27 Aug 2011 | 25 comments

2 votes
Optimization for loading data into tables

Sample code for efficiently loading data into tables. More...

Posted by OderWat, Posted on 18 Jun 2010, Last updated 7 Oct 2010 | 0 comments

3 votes
Shuffle/randomize Tables

The following function implements the modern version of the Fisher-Yates shuffling algorithm: 1 2 3 4 5 6 7 8 9 10 function table.shuffle(t)         math.randomseed(os.time())         assert(t, "table.shuffle() expected a table, got nil")         local iterations = #t         local j  ... More...

Posted by Ludicrous Software, Posted on 7 Jan 2011, Last updated 7 Jan 2011 | 19 comments

2 votes
Bresenham's line algorithm

Here is Bresenham's line algorithm in Lua/Corona if anyone is interested... More...

Posted by garysims, Posted on 19 Feb 2010, Last updated 7 Oct 2010 | 0 comments

1 vote
Async/Sync State Management For Debug

I got really excited when I read about Niels Async HTTP workaround using Web Pop Ups. I realised early on the difficulty of trying to debug code which couldn't run within the Corona Simulator which doesn't support Web Pop Ups. I wrote some code which which can switch between Sync for local debug, and Async for deployment to the phone. In order to maintain the event flow I had to build in an onComplete event for Sync... More...

Posted by bedhouin, Posted on 14 Dec 2010, Last updated 14 Dec 2010 | 0 comments

1 vote
Significantly more efficient (at least for Lua) line algorithm

Efficient line drawing function. More...

Posted by SteveK, Posted on 5 Apr 2010, Last updated 7 Oct 2010 | 1 comments