Top Rated

Top Rated

Top rated 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

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

28 votes
Ice

Ice allows you save and load data when using the Corona ® SDK. It is very simple to use and allows you to create as many 'iceboxes' as you like. Great for storing local high scores, settings and other data. I hope to update my site here - http://grahamranson.co.uk/lib.php?id=6 - with proper usage instructions but until then you can get the majority of stuff done pretty easily. 1 2 3 4 5 6 7 require( "ice... More...

Posted by GrahamRanson, Posted on 29 Sep 2011, Last updated 13 Nov 2011 | 282 comments

23 votes
Crawl Space Library

Hey all, I'm finally getting around to submitting this! I know many of your are already using it, but for folks who aren't following me on Twitter ( @AdamBuchweitz ), here is a link to the Crawl Space Library. It's open source and on GitHub here: http://github.com/AdamBuchweitz/CrawlSpaceLib and you will find the management site here: http://library.crawlspacegames.com where you can see the latest activity, submit... More...

Posted by AdamBucketz, Posted on 29 Mar 2011, Last updated 20 Apr 2011 | 21 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

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

16 votes
Tilt Monster

Tilt Monster (formerly known in the App Store as Doodle Dash!) was the FIRST project of Jonathan Beebe, and was one of (if not THE) first Corona SDK game to reach over 100,000 sales in the App Store! (Special thanks to Biffy Beebe for the artwork/graphics assets, and her ideas and inspiration throughout the development process--this is the project that did it for us!) More...

Posted by jonathanbeebe, Posted on 25 May 2011, Last updated 18 Oct 2011 | 47 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

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

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

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

13 votes
Raycasting Engine

Back in 1997, I wrote a raycasting engine in Turbo Pascal. It had a number of features and was heading towards being turned into a fully fledged game engine. That never happened. But since then, as I move between development platforms, I like to port a cutdown version of it to help make me familiar with the syntax and API on the new platform. Here is a basic raycasting engine written in LUA with the Corona SDK. More...

Posted by Jesder, Posted on 14 Feb 2012, Last updated 14 Feb 2012 | 13 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

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

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

12 votes
Pinch Zoom XL

Update 8/10/11 - Now with more zoom! - Added tap detection. Double tap to zoom 2x, double tap again to return. Double tap from any scale to return to original scale. - Various tweaks. No longer jiggles with three fingers. Removing/replacing fingers behaves better. This is just a slight improvement of the Pinch Zoom example from the sample apps. It now supports one touch move and the zooming centers around where you... More...

Posted by duff333, Posted on 16 Jun 2011, Last updated 10 Aug 2011 | 40 comments

12 votes
Texturemapped Raycasting Engine

As a follow up to my original code share of the Corona port I did of my 2D raycasting engine, texture mapped walls have been added. This was achieved using sprite sheets. The downside of this is the frame rate takes quite a hit compared with the flat filled walls shown in the original sample. I know I can optimise how I use sprites in this demo, but I still think more needs to be done to get the frame rate up -... More...

Posted by Jesder, Posted on 10 Mar 2012, Last updated 10 Mar 2012 | 17 comments

11 votes
Text-to-speech using network.download

As discussed here, Google provides an unofficial text-to-speech (TTS) API. It's quite easy to implement in Corona by modifying the Ansca-provided async network code. It could be useful for app accessibility or to have a synthesized voice speak when buttons are pressed, for example. More...

Posted by Dotnaught, Posted on 13 Feb 2011, Last updated 13 Feb 2011 | 2 comments

11 votes
Promotion Library

The Promotion Library is a simple library to download news from a server and displaying it in a sliding window if the news was updated. It also includes an easy to use function to show a "please rate" dialogue every X launches, giving the user the choice to rate, ignore or never be asked again. Usage is as easy as it gets 1 2 3 4 5 -- Include the library promote = require(“promote”) -- Download News from... More...

Posted by 0x90, Posted on 28 Feb 2011, Last updated 28 Feb 2011 | 12 comments

11 votes
Ad Mediator for Corona®

Ad Mediator for Corona is a client-side ad mediation module very much like AdWhirl. It supports admob, inmobi, inneractive, herewead and house ads out of the box and can be extended easily by using a simple plugin framework. Ad Mediator is using providers' http api interface to request and fetch ad banners. By using this method, it knows whether there aren't any ads from a provider and able to select next available... More...

Posted by deniz, Posted on 16 Feb 2012, Last updated 13 Mar 2012 | 88 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

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

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

9 votes
Auto Wrapped Text updated

I needed a way to accurately (and quickly) create a wrapped text group to display in lists. I took prior versions of this that were posted here and hopefully improved on the wrapping logic. I did this by estimating how many characters can be placed on a line by looking at the current width of the line and dividing by the number of chars in this line. Only when it is estimated that the line may need to wrap does... More...

Posted by tom.knox7, Posted on 20 Apr 2011, Last updated 20 Apr 2011 | 18 comments

9 votes
Corona Lottery Scratch Ticket

I created this as an attempt to mimic one of those lottery scratch cards, you know where you take the coin and rub all that stupid foil onto your lap? Corona makes this surprisingly simple, you will crack up at how little code it takes for this very cool effect. I used this in my Amber Rays application and plan on using i in lots more. I tried using native circles at first, you'll see the code in there. Works... More...

Posted by croisened, Posted on 25 Apr 2011, Last updated 25 Apr 2011 | 7 comments

9 votes
How to make an Angry Birds catapult

Catapults like that found in Angry Birds and Hot Cross Bunnies are a staple weapon in the arsenal of any mobile gamer. We thought we'd share with you how to put together a slingshot catapult that looks great and feels authentic. More...

Posted by Fixdit, Posted on 18 May 2011, Last updated 25 Jan 2012 | 23 comments

9 votes
Enhanced UI Library (ui.lua)

UPDATED to 2.4 Most current copy of and ZIP download available at my website. http://www.pixelenvision.com/1562/coronasdk-enhanced-ui-library-ui-lua/ NEW: Added event support, now returns even.target, event.x & event.y values. You can use x/y values to provide different actions based on the coordinates of the touch event reative to the x/y size of the button image. NEW: isActive state enhanced, so the button can... More...

Posted by PixelEnvision, Posted on 31 May 2011, Last updated 1 Oct 2011 | 93 comments

9 votes
Pauseable timers and transitions with speed adjustment

After searching for pausable timers for corona I found only several implementations. Beebe used enterFrame listener to implement his own timers and transitions. Transition manager has memory leaks and lacks some functionality. So I decided to wrap around existing corona timers and transitions into my own implementation. Remember to free the memory used by this module, I advice you you to call... More...

Posted by Lerg, Posted on 18 Jun 2011, Last updated 14 Apr 2012 | 37 comments

9 votes
Rotate object with finger

I have been trying to figure out how to rotate an object with my finger by moving it in clockwise or counter-clockwise position. After much Math searching and confusion, I think I got it. Here it is: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 local function rotateObj(event)         local t = event.target         local phase = event.phase        ... More...

Posted by ChunkyApps, Posted on 14 Jul 2011, Last updated 14 Jul 2011 | 13 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

8 votes
Gesture recognition library for Corona SDK

Simple gesture recognition library for Corona SDK using Point Reduction Code and Levenshtein distance algorithm ( http://en.wikipedia.org/wiki/Levenshtein_distance ). Gesture pattern: http://twitpic.com/4a4otc Circle / O, square, triangle, swype up/down/left/right also included. Usage sample: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 local Gesture = require("lib_gesture")   local pointsTable = {... More...

Posted by gtatarkin, Posted on 19 Mar 2011, Last updated 19 Mar 2011 | 27 comments

8 votes
Flickr Photo Browser

Awhile ago, I was approached to do a custom app for someone. The app itself is finished (not published yet) and in the process of creating it I thought it would be a good idea to publish the source for the dynamic image slider control I created. Well, not content with just publishing a simple control, I decided to create an entire demonstration app to see it in action. The Flickr Photo Browser is the result of this... More...

Posted by codepunk_schmidt, Posted on 20 Sep 2011, Last updated 20 Sep 2011 | 9 comments

8 votes
Text Wrapper Class

As I needed some text features for my actual project, I wrote a class to wrap some text. Unfortunately I saw only now that there is still one form tom.knox7. As there are a bit more features in my class, i post it anyway for someone who need this features maybe. --------------------------------------------------------------- There are two main usages of the module: 1. You can wrap any text to a desired width, the... More...

Posted by sunmils, Posted on 22 Dec 2011, Last updated 14 Feb 2012 | 48 comments

8 votes
Grid Manipulation Sample Code

This code allows you to move your player by touching the screen. The grid will then manipulate according to the players position. You can change the radius of the manipulated area, and change the line width. We are having problems with lag if there are multiply objects on the grid. If anyone can help solve the issue, we will update our code accordingly. Hope this helps! More...

Posted by Ninja Pig Studios, Posted on 6 Feb 2012, Last updated 3 Mar 2012 | 8 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

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

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

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

7 votes
Simple Analog Stick (Joystick) Module

Here's a clean, simple analog stick (joystick) module for your convenience -use it anywhere and anyhow you like to. - Create an unlimited amount of analog sticks at once - Retrieve angle, distance, strength of each stick - Move your character using a single line only ( MyStick:move() ) - Slim and clean code, easy to customize or extend - Snaps back smoothly when released (slow-down) - Working sample included (runs... More...

Posted by x-pressive.com, Posted on 13 May 2011, Last updated 13 May 2011 | 23 comments

7 votes
Upload binary from Corona to PHP script

Uploading a binary from your app to a web server is a bit tricky with Corona... but not if you have this code! ;-) Here's all you need in order to get it done... In your app, you'll want this uploadBinary function: 1 2 3 4 5 6 7 8 9 10 11 function uploadBinary ( filename, url, onComplete )           local mime = require "mime"         local path =... More...

Posted by kennw, Posted on 25 Jun 2011, Last updated 30 Jan 2012 | 27 comments

7 votes
Audio Pitch / Turntable Example

A basic turntable example to demonstrate the "hidden" OpenAL audio pitch feature in Corona and possibly the smallest turntable code ever^^ You can change the music's pitch in realtime by turning the knob / turntable. Requires only 20 lines of code. Use any "knob" image as a graphic and any sound file of your choice or download the .zip file here (all media included): DOWNLOAD main.lua (requires two files named "knob... More...

Posted by x-pressive.com, Posted on 28 Jul 2011, Last updated 28 Jul 2011 | 5 comments

7 votes
Director Slim - Stripped down Director Class

I've managed to strip it down to only 15 lines of code! That's right. Plus 6 lines for the header. Works faster, with lower overhead - hence higher performance. UPDATE 2011-11-05: Reduced to 15 lines. Fully working example added to GitHub. I didn't like director 1.3 when it came out, so I decided to stick with version 1.2a - the one with improved group cleaning function. I was fine with it thanks to Ricardo and... More...

Posted by Lerg, Posted on 29 Oct 2011, Last updated 4 Nov 2011 | 37 comments

7 votes
Missile Command

A step-by-step tutorial showing how to create a Missile Command game using the Corona SDK. The resulting game is compatible across iOS and Android devices. The repository includes: assets: all of the graphics, audio, etc. required in the game; exercises: if you want to start with a particular exercise, then you can refer to the corresponding folder and start from there; MissileCommand: the finished game, if you... More...

Posted by Ludicrous Software, Posted on 24 Nov 2011, Last updated 24 Nov 2011 | 3 comments

7 votes
Page Curl

One of the Tutorials that Jonathan Beebe wrote showed how to implement a page curl effect for your apps. Unfortunately there are some problems with that short example and a number of people have requested fixes. I've modified Jonathan's code heavily and modularized it so people can implement page curl with just a couple of lines of code. I've also fixed the issue that some people were experiencing. Here is an... More...

Posted by KenRogoway, Posted on 14 Feb 2012, Last updated 14 Feb 2012 | 15 comments

7 votes
Maths Library

NOTE: I have commented out the line at the top, so you now only need to require the mathlib in your main.lua and Disclaimer: I am not a mathematician and never will be. The library I've posted here has been developed to help me do things I don't really understand. I have derived all the code here either from first principles or translated it from other code posted to forums and which I can rely on working. It is... More...

Posted by horacebury, Posted on 15 Feb 2012, Last updated 11 May 2012 | 8 comments

7 votes
Collisionator - Filter Generator

I've created a tool to generate collision filters quickly for use in apps & games: http://labs.zanuka.com/collisionator3000XL/index.html * UPDATE: New version uploaded April 2, 2012. This version automatically selects the reciprocal object collision so you no longer have to tick both manually. For example if you want object 2 to collide with object 1, just select one collision in the grid and the other will be... More...

Posted by ZANUKA, Posted on 22 Mar 2012, Last updated 1 Apr 2012 | 11 comments

7 votes
Rate It Button

I made a simple extension that makes it easier to add a "Rate it" button to a Game or App. 1 2 3 4 5 6 7 8 9 10   local rateit = require("rateit")     rateit.setiTunesURL(1234564)   rateit.setAndroidURL(1234564)     function buttonTouched(event)     rateit.openURL()     end Simple version of using it within what... More...

Posted by Richard P., Posted on 24 Mar 2012, Last updated 25 Mar 2012 | 7 comments

7 votes
Parse for Corona SDK

This sample project shows how to communicate with Parse.com, a back-end data service, from a Corona SDK app. You should be able to adapt it to your needs with minimal changes. See main.lua for a barebones UI. To use the parse.lua module, add: 1 local Parse = require("parse") to your main project file and refer to functions as shown in main.lua. You'll want to use SDK build 2012.782 or later, for... More...

Posted by Dotnaught, Posted on 15 Apr 2012, Last updated 15 Apr 2012 | 4 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

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

6 votes
UTF-8 conversion utility

Corona supports UTF-8 character strings, while Lua (albeit being UTF-8 compliant) primarily expects 8-bit ASCII only. The following functions convert between a single UTF-8 sequence and its Unicode code point and vice-versa: More...

Posted by Rozek, Posted on 23 Apr 2010, Last updated 7 Oct 2010 | 4 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

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

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

6 votes
Match The Letter

Match The Letter is a simple picture game for helping kids learn their letters. I posted the source to github. I built it both for my son to play with and to get more familiar with Corona, so any feedback is appreciated. https://github.com/johnpolacek/Match-The-Letter-Game The app is available for download on the iTunes App Store and Google Marketplace. For more info, go to http://johnpolacek.com/matchtheletter More...

Posted by johnpolacek, Posted on 9 Mar 2011, Last updated 18 Oct 2011 | 11 comments

6 votes
Curve Fitting - Catmull Spline

Simple curve fitting with a Catmull Spline Calculation, you can now draw a curve between 3 or more points. Use the code to generate a secondary array of points to be appended to a line. The red curve generated should not be used, instead set the steps to 5 and use the points generated to draw a line using the display.newLine() function. You should remove the code for drawing the dots and pass an array instead. 1 2 3... More...

Posted by Matthew Pringle, Posted on 8 May 2011, Last updated 12 May 2011 | 6 comments

6 votes
Proper Orientation Rotation with Animation UPDATED

Current copy of that code also available at my website. http://www.pixelenvision.com/1551/coronasdk-proper-orientation-rotation-with-animation/ As you might know, when you change the orientation of an iOS device, on screen view is rotated with an animation. Current build of Corona SDK (2011.509) does support native orientation changes, but without animation. So, when you rotate the device, content on the OpenGL... More...

Posted by PixelEnvision, Posted on 16 May 2011, Last updated 13 Aug 2011 | 17 comments

6 votes
Corona SDK API Reference --> The App!

The Corona SDK API Reference App -- install it on your device for quick access to all the API info you need. ---> http://www.21x20.com/corona/CoronaAPIs.zip Screenshot: ---> http://www.21x20.com/corona/CoronaAPIsShot.png This just pulls the API list from the Corona SDK API Matrix and deals with it, so it's always up to date. It makes sloppy assumptions about the layout of the page, so if they ever change... More...

Posted by kennw, Posted on 22 Jul 2011, Last updated 22 Jul 2011 | 4 comments

6 votes
A* Pathfinding Demo

This tutorial utilizes the great A* pathfinding code uploaded by Lerg which is found here: http://developer.anscamobile.com/code/pathfinding-module More...

Posted by codepunk_schmidt, Posted on 29 Aug 2011, Last updated 29 Aug 2011 | 14 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

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

5 votes
Flip/Mirror tips

This is a basic trick, but I can't find any reference of it in the doc, so... If you want to flip and/or mirror a display object, scale it negatively : More...

Posted by Chman, Posted on 6 Feb 2010, Last updated 7 Oct 2010 | 2 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

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

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

5 votes
Charts

Charts is a really simple module that wraps up the Google Charts API, currently only Pie charts and QR codes are supported however I can and will add more. It just takes time. Creating the charts is simple, a QR code can be generated like this: 1 2 3 4 5 6 7 8 9 10 11 local qrCode = charts.newChart {         type = "qr",         data = "Corona Rocks!... More...

Posted by GrahamRanson, Posted on 20 Feb 2011, Last updated 13 Jan 2012 | 23 comments

5 votes
PropertyBag class for CoronaSDK

Hi, I have just created a new class library that you can drop into your projects and use for KeyValues, it can be found on my GIT project page at https://github.com/JayantVarma/Rating-Dialog-CoronaSDK The way to use it is simple, here's an example 1 2 3 4 5 6 7 8 9 10 11 local prop = require("property")   local propertyBag = prop:init()   --Properties created in memory... More...

Posted by JayantV, Posted on 14 Mar 2011, Last updated 21 Mar 2011 | 33 comments

5 votes
Cross-platform asynchronous HTTP request

This is our asynchronous http request library implemented in pure lua. Thus, it can be used on Simulator, Android and iOS. Usage: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 require "asyncHttp"   print("-------------------------------------------------------") local url = "http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=Corona+SDK" --The interface is similar to corona'... More...

Posted by khanh.dq, Posted on 21 Mar 2011, Last updated 21 Mar 2011 | 1 comments

5 votes
Custom iOS Wheel Picker **Looks Native**

Latest Version: 1.0 --- Download Here --- While we're all waiting for CoronaUI to come out, here's a custom wheel picker that looks and behaves like native iOS Wheel Pickers! Just unzip, drop the folder and two files into your project's directory and follow the simple instructions to get it working. More...

Posted by jonbeebe, Posted on 27 Mar 2011, Last updated 27 Mar 2011 | 11 comments

5 votes
Air Hockey 2 Player Game

Air Hockey is a two player game designed to show off some of the physics engine properties of Corona SDK and how with a few lines of code you can write a very addictive game. First one to score five points wins. Works seamlessly across iOS and Android devices. Open sourced MIT Licensed. Feel free to use the code as you wish. If you decide you want to make changes or additions, feel free to do so and let us know to... More...

Posted by carlos m. icaza, Posted on 20 Apr 2011, Last updated 18 Oct 2011 | 10 comments

5 votes
Custom Particle Emitter Package

I have created a simple Custom Particle Emitter package. You can create particles of required number, size and duration with just a few lines of code. It is also possible to create decent Smoke effects and other effects with this. Feel free to experiment with the code by using different values or even some code tweaking and share it here. USAGE: 1 2 3 4 local emitter = require("emitter") local... More...

Posted by prasannakkcse, Posted on 27 Jun 2011, Last updated 28 Jun 2011 | 13 comments

5 votes
ALexplorer

Exercises some of Corona's "secret" OpenAL features as described in our blog entry The secret/undocumented audio APIs in Corona. Also uses simple sprite animation and some Widgets (requires Corona build 579 or so). Please use with care. Support is very limited; the Corona OpenAL APIs used here may change or be removed entirely. Additional Information: More...

Posted by snarla, Posted on 27 Jul 2011, Last updated 19 Aug 2011 | 0 comments

5 votes
Implementing Lightning Effects in Corona

I've implemented the lightning effect in Corona SDK using Lua and the algorithm as described in the following article. http://drilian.com/2009/02/25/lightning-bolts/ The result can be seen here: http://www.youtube.com/watch?v=JnRxfs87ppk The vector class I used in this file was extended from the following gist: https://gist.github.com/1006414 Write something like this to create a new lightning. You need to pass the... More...

Posted by sithu1986, Posted on 26 Aug 2011, Last updated 26 Aug 2011 | 4 comments

5 votes
Virtual DPad/Joystick template

I've made a virtual dpad to test a tilt-based project and came out with something I think will be really useful for those out there wandering how to make a virtual controller for their apps. Its features are: - Visible only at finger touch. - Tracks angle and magnitude. - Draggable from its bounds. - Confined to screen limits. The download link and a video showing the thing in action can be found at our website:... More...

Posted by Alejandro Jimenez, Posted on 19 Nov 2011, Last updated 19 Nov 2011 | 9 comments

5 votes
Calculating actual boundaries of your application and device screen size

When you develop some Corona application, you most probably use some content scaling option specified in your config.lua file. Content scaling is described perfectly in this blog post: http://blog.anscamobile.com/2010/11/content-scaling-made-easy/ More...

Posted by mmagrilov, Posted on 13 Jan 2012, Last updated 16 Feb 2012 | 7 comments

5 votes
Follow (and avoid) Object

I ported this nice AS2 follow-object script by Philip Radvan see the original post here http://www.freeactionscript.com/2009/04/enemy-behavior-run-away-follow-player/ fin.lua 1 2 3 4 5 6 7 8 9 10 11 12 local fin = {} local radians = 180/math.pi  --> precalculate radians   fin.distanceBetween = function ( pos1, pos2 )          local sqrt = math.sqrt  ... More...

Posted by canupa.com, Posted on 18 Jan 2012, Last updated 29 Apr 2012 | 12 comments

5 votes
Easy Finger Drawing with Undo Functionality

For an app I am soon to release, I needed to allow the user to draw a series of squiggily lines with his or her finger, and to be able to reference or remove specific lines/strokes. The closest bit of code I could find online was actually provided by Carlos (https://developer.anscamobile.com/forum/2011/05/02/need-some-help), but I found that his solution of appending new points onto a single line got laggy the... More...

Posted by jasonschroeder, Posted on 30 Jan 2012, Last updated 30 Jan 2012 | 11 comments

5 votes
Fractal Art

This is a sample that will render some fractal art using lua and the Corona API. A few years back, I took an interest in fractals and was curious about how to make them. This sample is a port of a C++ sample I wrote back then, showing how to create Mandelbrot and Julia sets. Here you can toggle between them by pressing the toggle button in the lower right corner. There is a small delay on start up as it calculates... More...

Posted by Jesder, Posted on 14 Feb 2012, Last updated 14 Feb 2012 | 1 comments

5 votes
Scrollable Lists (Scrollview alike)

I've recently created a module for lists for one of our apps and I think it is worth sharing. It basically creates lists, both vertical and horizontal using strings (for text lists) or display objects (possibly groups). It is highly customizable. Lists behave like iOS lists where one can scroll farther than the end, and upon release the lists gets back to the last element. Also has momentum for fast scrolling of... More...

Posted by CluelessIdeas, Posted on 28 Feb 2012, Last updated 28 Feb 2012 | 14 comments

5 votes
3D Object Rendering

A new example I wanted to share with you guys, was some 3D Object rendering. Not quite as exciting at the raycasting sample I posted a few weeks back, but still interesting enough I think ;) Glenz: Wireframe: More...

Posted by Jesder, Posted on 2 Mar 2012, Last updated 2 Mar 2012 | 4 comments

5 votes
Streaming "News Ticker" (Twitter Feed or Online Text File)

I wrote the following bit of code for an app I'm working on where I wanted to have a "news ticker" scroll along the bottom of the home screen that I could change remotely. I also briefly considered streaming the most recent tweets from a Twitter account - so I'm including that code as well. See the commented-out text below for notes on how to change the ticker text or Twitter feed that displays. If you copy this... More...

Posted by jasonschroeder, Posted on 6 Mar 2012, Last updated 6 Mar 2012 | 24 comments

5 votes
Improved Page Curls

Heres an example of how to make an attractive AND interactive realistic page curling effect. It's all the little things that really add up in the end to make the illusion convincing. The full project file can be found in the GitHub link along with all the images you will need. http://img856.imageshack.us/i/screenshot20120329at401.png http://img829.imageshack.us/i/screenshot20120329at400.png http://img545.imageshack.... More...

Posted by dedoubleyou1, Posted on 15 Mar 2012, Last updated 29 Mar 2012 | 12 comments

5 votes
Quick Bubble Popper

Another common forum request. This will show some spawning, touch handling with table listener and object removal. Also shows some forward declarations for the "cart-before-the-horse" issue. Added some collision bounds and EndGame removal mechanics. Added some Group usage examples and proper reverse-removal of objects. Also note use of .alive to prevent "double-taps". Split into module to show ONE WAY this can be... More...

Posted by TheRealTonyK, Posted on 1 Apr 2012, Last updated 1 Apr 2012 | 12 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

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

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

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

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

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

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

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

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

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

4 votes
print() function from device *small dirty hack*

For those who are looking for quick way to implement print function to do quick debugging while testing on device, can use following method Open a terminal window on your mac, and type following command 1 nc -l -k 1234 This creates quick dirty listener using builtin utility nc (netcat) at port 1234 now in your Corona code, define following function and use it to send string data to above terminal :) 1 2 3 4 5... More...

Posted by chinmay.patil, Posted on 1 May 2011, Last updated 1 May 2011 | 4 comments

4 votes
Animation along a Path (via Flash)

I've been looking for ways to get animation along a path and thought I would share what I came up with. This requires Flash but where else would you be making your animations, eh? 1. First, set up your animation in Flash. Along a path or not. 2. Name the symbol instances "object" (If you change, make sure you alter the Actionscript to match) 3. Use this Actionscript in the first frame of your animation: 1 2 3 4 5 6... More...

Posted by ChunkyApps, Posted on 24 May 2011, Last updated 14 Jul 2011 | 6 comments

4 votes
Flight Path

You are in charge. You are the Head Honcho at the new Nimitz class of nuclear powered aircraft carrier and your job is to make sure that every plane/helicopter lands safely. This sample project is provided for you learn a different type of game that can be developed using Corona. It is up to you now to implement sound, different planes, water movement, score, etc. The code is very simple to follow and as usual it... More...

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

4 votes
Texture Memory Monitor

A utility to monitor texture memory usage. 2011.305 on. Require mtm.lua in your main file before any texture memory is used. At exit or another time of your choosing, call mtm.report() to get a list of what has not been freed. The following functions are monitored: display.newImage() display.newImageRect() display.loadRemoteImage() display.newText() display.remove() Set VERBOSE = true to get a list of... More...

Posted by Shenandoah01, Posted on 6 Jun 2011, Last updated 6 Jun 2011 | 31 comments

4 votes
Parallax Class

par·al·lax The apparent displacement of an observed object due to a change in the position of the observer. Imagine yourself in a car looking to one side. The grass next to the road goes by fast while the trees in the middle of the field look slower. Meanwhile, the far away mountains look like they are barely moving. This is the essence of parallax. More...

Posted by duff333, Posted on 19 Jul 2011, Last updated 5 Feb 2012 | 31 comments

4 votes
Notification popup

Here's one of my utility functions from my project. It allows you to slide up notification message from the bottom and hide down after some time. Save this file as notification.lua 1 2 3 4 5 6 7 8 9 10 11 12 13 module(..., package.seeall)   function autoWrappedText(text, font, size, color, width)         --print("text: " .. text)         if text... More...

Posted by sithu1986, Posted on 14 Aug 2011, Last updated 14 Aug 2011 | 8 comments