Share Your Code

User Interface

Sort by: Latest Additions | Most Viewed | Recently Updated | Top Rated

The latest additions of sample code and code libraries shared by developers for Corona SDK.

0 votes
Simple Polygon Triangulation

I've been looking for a way to break a simple polygon into component polygons for a while. I won't tell you why because I'm using it in a game, but I just had to share this solution. It takes any clockwise winding polygon (entered by tapping the screen in sequence) and breaks it into it's interior triangles - literally "triangulation." I can't take credit for the math, which was the only complete and understandable... More...

Posted by horacebury, Posted on 4 May 2012, Last updated 4 May 2012 | 1 comments

1 vote
Action sheet for corona.

CActionSheet *** IMPORTANT **** This file uses the widgets library so it must be in your project if you plan to use it I haven't done much lua programming (1.5 days), I used segmented control I found here somewhere and couldn't find an action sheet one, so I looked at how they did it and created a action sheet. Thanks to the original person who posted the segmented control here somewhere... HOW TO INSTALL 1) copy... More...

Posted by AppIt All, Posted on 23 Apr 2012, Last updated 24 Apr 2012 | 3 comments

1 vote
Basic Grid / Table Renderer

Very rudimentary function to render tabular or grid data in exactly that fashion, ie. a table or grid. createGrid function requires two variables: design/layout settings and data to populate the table. Please see comments in grid.lua for implementation. Readme.txt on github will be updated if need be. Right, that explanation more than aptly explains it I believe. Now, how to get to this 50 word limit. Enough yet? More...

Posted by raurir, Posted on 5 Apr 2012, Last updated 5 Apr 2012 | 1 comments

0 votes
Polygon fill and Point in Polygon detection

Source of my inspiration: http://alienryderflex.com/tutorials.shtml local widthheight, isclosed, isperpixel = 1, false, false local widthheight, isclosed, isperpixel = 10, true, true NOTE: The functions in this demo are provided in the mathlib.lua found here: More...

Posted by horacebury, Posted on 5 Apr 2012, Last updated 5 Apr 2012 | 2 comments

3 votes
Cat-mull-rom open and closed

So, got back into the old bezier stuff again and figured it might be fun to try and get the curve passing straight through the control points. Makes it more useful for plotting courses for game characters, because players are not going to be drawing lines and placing control points - they'll just drag out a path or whatever and the character should traverse it, etc... More...

Posted by horacebury, Posted on 25 Mar 2012, Last updated 25 Mar 2012 | 0 comments

0 votes
Display Extensions

With so many regular operations being performed by code I thought it was time I wrote a library which helps with all this. Operations provided are: - Making a shorter global reference to the stage object - An 'indexOf' function for finding the index of a display object within a display group As with my other libraries, this will grow with time. You may notice that there are some functions designed to extend the '... More...

Posted by horacebury, Posted on 21 Mar 2012, Last updated 5 Apr 2012 | 1 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

4 votes
(Not-) Verlet Rope

Just playing about with some of Carlos' code and thought to myself, "Doesn't the bezier line look like a rope?"... So I made the control points physics objects, joined them with distance joints and fixed the first one in place. While the following code has major performance issues, I'm sure, it could probably serve as the basis for some interesting effects. I have commented in CAPITALS everywhere I've changed the... More...

Posted by horacebury, Posted on 15 Mar 2012, Last updated 15 Mar 2012 | 2 comments

2 votes
Storyboard Goto (no initial delay)

This fix eliminating the initial delay explained in this thread: http://developer.anscamobile.com/forum/2011/12/03/initial-delay-storyboardgotoscene In your main.lua override the gotoScene function 1 2 3 4 5 -- require controller module  local storyboard = require "storyboard   -- override goto function storyboard.gotoScene = require "goto" Add file goto.lua 1 2 3 4 5 6 7 8 9 10 -- Project:... More...

Posted by Johantd04, Posted on 13 Mar 2012, Last updated 13 Mar 2012 | 5 comments

0 votes
Stopwatch Timing Class

Current Version: 1.2 Stopwatch is an easy way to create and manage timers (not the performWithDelay kind!), clocks, and any other timekeeping your app might require. Count down to from any number to 0, count up to infinity, pause and resume, and more! 0. Require stopwatch Simply add stopwatch.lua to your project folder, and require it into the files you need it like so: 1 local stopwatch = require "stopwatch... More...

Posted by Revaerie, Posted on 9 Mar 2012, Last updated 9 Apr 2012 | 19 comments

2 votes
Simple draggable fan demo 2

Due to the Mobile Me / iCloud motions going on, the original Simple draggable fan demo is no longer available. There were considerable bugs with it, so I thought I'd write it from scratch with more reliable code. The main.lua is below, but please go here to get the mathlib.lua, which it requires: mathlib.lua: http://developer.anscamobile.com/code/maths-library main.lua: 1 2 3 4 5 6 7 8 9 -- simple draggable fan demo... More...

Posted by horacebury, Posted on 29 Feb 2012, Last updated 29 Feb 2012 | 0 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

3 votes
Asteroids

I got hit with the urge to write the Atari classic Asteroids using the physics engine and a "no button" touch controls. So, here's the source code. It's really messy, not object oriented but it shouldn't throw too many errors and I've tried to handle the object removal etc reasonably well. There are some principles which n00bs could learn from and some which you should avoid, but all in all if you were to take the... More...

Posted by horacebury, Posted on 27 Feb 2012, Last updated 28 Feb 2012 | 10 comments

0 votes
Ultra Simple Parallax Scrolling

So this is a parallax scrolling module that will handle up to 5 "layers" of parallax. This is made for landscape orientation, but you should be able to just flip a few things in the file and make it work for vertical as well. You can insert as many images as you want within each layer (minimum of 3, I don't think it'll work properly with only 2). Also, all images within each layer will need to be the exact same size... More...

Posted by 003naveen, Posted on 26 Feb 2012, Last updated 26 Feb 2012 | 1 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

3 votes
Device Metrics for scaling based on screen size

In trying to scale my application to various sized devices from an iPhone to an iPad and everything in between (particularly the Kindle Fire and Nook Color), I have been frustrated by the lack of Corona support for physical screen size. If you want an application to truly scale (and not just be a sized-up phone app when you run on a tablet), then you have to be aware of the physical size of the screen. More...

Posted by bob.dickinson, Posted on 8 Feb 2012, Last updated 8 Feb 2012 | 21 comments

4 votes
Particle Candy Effects Creator

This is a simple helper project to ease the creation of Particle Candy effects. I've been looking for a decent GUI to help me invent particle candy effects and couldn't find anything working, so I decided to go ahead and create my own GUI. For now it allows to adjust only Particle Type properties [and without fancy FX or fields or anything like that], but if you would like to get more, please let me know. More...

Posted by krystian6, Posted on 5 Feb 2012, Last updated 17 May 2012 | 30 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

1 vote
cipr.ui

User interface utilities for Corona, part of the Cipr project. Installation Installation is done with cipr 1 cipr install git://github.com/six8/cipr.ui.git Usage Some examples. See Getting started with Cipr for more examples. See source for full functionality. EffectChain More...

Posted by cixate, Posted on 28 Jan 2012, Last updated 28 Jan 2012 | 0 comments

0 votes
Running Clock

This code will create a variable running timer for your game/app. Please see below for what to set it up. Functions: clock.cancelTimers(): This will cancel or pause your timers clock.resumeTimers(): This will resume your timers from a clock.cancelTimer call First you have to require the clock by writing: 1 local clock = require("clock") Then to set up a clock you have to follow this: 1 2 3 4 5 6 7... More...

Posted by jeremyapplebaum12, Posted on 22 Jan 2012, Last updated 22 Jan 2012 | 2 comments

1 vote
Simple PDF Reader App

Use this little piece of code to display PDF file in your Corona Apps! I'm running Corona Version 2012.726 (2012.12.8). --------------------------------------------- TESTED ON --------------------------------------------- -Xcode iOS simulator -iPhone 4 and iPad 2 running iOS 5.0.1 --------------------------------------------- LIMITATION TO DISPLAYING PDF FILES USING THIS METHOD... More...

Posted by iTrain Dev, Posted on 20 Jan 2012, Last updated 20 Jan 2012 | 1 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

2 votes
TileBG - Tile and manage a image on the display background

I'm still on my demo time, trying to get the hang of this Corona thing... loving every minute! I was trying to do what I thought would be simple...tile an image on the background of the display. And thats what this does: It detects your display content height and attempts to calculate the minimum number of tiles needed (based on the size of the provided background tile.) This is simple to use: 1) Include the... More...

Posted by ethanpil, Posted on 2 Jan 2012, Last updated 2 Jan 2012 | 0 comments

0 votes
Easy custom TextBoxes with custom keyboard

Hi! Native textboxes have a lot of little troubles in game apps with fonts, scene changes, etc. I have coded this custom textboxes with is own custom keyboard for easy text entry in games that not need a complete keyboard. The code needs TextCandy library for work, but you can easily modify for not need it. Scroll text inside the text box or limit text length is not implemented yet! 1 TextCandy = require("... More...

Posted by josua, Posted on 26 Dec 2011, Last updated 26 Dec 2011 | 2 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

1 vote
Virtual Reality Experiment

An experiment to show a virtual reality still image using Corona SDK. In theory, this could be an animation, too... feel free! The app senses the physical attitude of the device using the gyroscope. As you turn the device, the image moves, as though you were turning your head. You can spin in a chair and see the world around you. It seems to freeze in the vertical some times. Quit the app, shut it down, and it... More...

Posted by mimetic, Posted on 17 Dec 2011, Last updated 18 Dec 2011 | 5 comments

2 votes
Dynamic Resolution Retina Text Class

Overview: Autoscaling retina text with a unified API, embossed option, automatic reference pointing and repositioning. ---- Hey guys, I'm sharing this simple text class because I've personally run into a lot of trouble getting text to scale and align perfectly in Corona over many screen sizes. I'd assume most of you are using some custom workarounds already! More...

Posted by Revaerie, Posted on 14 Dec 2011, Last updated 3 Mar 2012 | 16 comments

2 votes
Multi-Point Pinch Zoom Rotate

Previous example: https://developer.anscamobile.com/code/pinch-zoom-rotate [EDIT: If you take a closer look at the main.lua, I had recently added code to pinch-zoom a display group, instead of an image. This means that the group can have a lower quality image at smaller scales and a larger image (lazily loaded) at larger scales. While this could be handled in the pinch library, I thought it better - for now - to... More...

Posted by horacebury, Posted on 2 Dec 2011, Last updated 15 Jan 2012 | 23 comments

2 votes
Pinch Zoom Rotate

For some time I have been wanting to write a usable pinch zoom with rotate algorithm. Finally, I think I have a serviceable piece. So, first off, usage: Give the code an image (I'm using yoda.jpg) Run the code Tap once to create the first or two touch points Tap somewhere else to create the second of the two touch points Drag one of the two touch points around to scale, rotate and move the image Tap once anywhere to... More...

Posted by horacebury, Posted on 27 Nov 2011, Last updated 28 Nov 2011 | 0 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

0 votes
HSV to RGB

A little snippet to help you converting HSV Colors to RGB. Useful if you want to have a well saturated Color or to get variations of a color! Example: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 display.setStatusBar(display.HiddenStatusBar)   local function hsvToRgb(h, s, v)         local r, g, b         local i         local f,... More...

Posted by xxxfanta, Posted on 15 Nov 2011, Last updated 15 Nov 2011 | 0 comments

3 votes
Corona Comics 2.0

The Corona Comics SDK 2.0 is based on the 1.0 version from November, 2010. In truth, this code is not as much an SDK as a demo of a fully functioning app using the code. It is a Lite version of Electric Eggplant’s iPad app, “Be Confident in Who You Are: A Middle School ConfidentialTM Graphic Novel” with all the functionality intact. It contains the opening animation and all of chapter 1, plus the Info page, and... More...

Posted by Gilbert, Posted on 11 Nov 2011, Last updated 11 Nov 2011 | 32 comments

0 votes
I18N Strings

Java-Like Locale String Resources (i18n) I found a few examples of locale string resource handling in Corona, but I wasn't satisfied. I thought Rosetta had a good thing going, but I couldn't use it as I wanted to. This class allows strings to be added in a genreal to more specific way. You set up the resources files from most general to most specific. The first one, strings.i18n, should always be present and... More...

Posted by bpappin, Posted on 29 Oct 2011, Last updated 29 Oct 2011 | 4 comments

1 vote
Example MessageBox code

A common feature in a lot of games and applications is the use of a MessageBox to display some text to the user and provide then with different buttons to signify what action they want to take. Something like a "Do you want to Exit?" with a Yes and No button. I have posted source for the cMessageBox.lua module along with sample tests showing the features of this code. The code depends on the ui.lua module (... More...

Posted by KenRogoway, Posted on 23 Oct 2011, Last updated 23 Oct 2011 | 9 comments

0 votes
Orientation Rotation in Web Popup

This code creates an app with a single, full screen native web overlay control. The main.html is loaded into it and JQuery is then used to repeatedly load a file indicating the device orientation. The orientation is detected within Corona and written to another HTML file. CSS is used to re-orient the web page within the web overlay control. Known issues: Demo does not adjust widths of HTML elements yet Demo does not... More...

Posted by horacebury, Posted on 23 Oct 2011, Last updated 23 Oct 2011 | 2 comments

1 vote
Simple Floating Keyboard (all Corona, no native)

Update 2011-10-27: - several bug fixes Download it from here: http://dl.dropbox.com/u/62099/sglkeyboard-v1.1.zip I'm working on a first app for Sixgreen Labs. We found it a real pain that the native inputs wouldn't work in the Simulator (although we understand why and empathize with the Corona team) I just wrote this up because I was getting consistant crashing in the Simulator from http://developer.anscamobile.com... More...

Posted by bpappin, Posted on 21 Oct 2011, Last updated 27 Oct 2011 | 4 comments

1 vote
Segmented Control Widget

Requires Corona Build 645 or higher! The segmented control widget has been removed from the upcoming widget version 0.2, so the source has been made publicly available here as a separate module. Here is the API documentation: More...

Posted by jonathanbeebe, Posted on 21 Oct 2011, Last updated 21 Oct 2011 | 6 comments

2 votes
Swipe Direction

Here is a way to detect swipe direction: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 local beginX local beginY   local endX   local endY   local xDistance   local yDistance     function checkSwipeDirection()           xDistance =  math.abs(endX - beginX) -- math.abs will return the absolute, or non-negative... More...

Posted by mf, Posted on 15 Oct 2011, Last updated 15 Oct 2011 | 5 comments

0 votes
we will miss you steve jobs by dsrawat4u@gmail.com

This tutorial is build for a tribute to "Steve Jobs:The man behind apple" From me(Deepak Singh Rawat) using a better way to understand movieclip action with buttons!! For more information check my blog :- www.anscacorona.blogspot.com or My youtube channel :- www.youtube.com/user/iphonemaclover thank you Have fun with corona SDK File included:- main.lua mainmenu.lua loadmainmenu.lua More...

Posted by Deepak Singh Rawat, Posted on 13 Oct 2011, Last updated 5 Dec 2011 | 3 comments

4 votes
Load Progress Bar

This example shows you how to add a progress bar to your loading screen. The progress bar updates after each data chunk is loaded. You can change the bUseListener value in cSceneLoad.lua to specify if you want the bar updated every frame, or just when each data chunk has been loaded (preferred method). This example is licensed under the MIT license so you are free to modify it and use it however you like. More...

Posted by KenRogoway, Posted on 12 Oct 2011, Last updated 12 Oct 2011 | 43 comments

1 vote
Using splash/load screen on Android

When developing apps for both iOS and Android I've wanted a standard way to display a splash screen while the app is loading. I've written a small module that provides 2 options: Option 1) iOS has a nice built-in feature that displays an image (Default.png) while the app is loading. This option takes advantage of the iOS image files. Option 2) If you don't want/need a graphic (which might in itself might take a few... More...

Posted by ingemar, Posted on 2 Oct 2011, Last updated 6 Oct 2011 | 1 comments

0 votes
A different way of managing dynamic image resolution [and scaling font size]

// A note: after a comment by nicholasclayg I've changed my code so that now it doesn't use "package.seeall" (now deprecated) and therefore doesn't use global namespace // // Note 2: I've loaded my example code (for Windows) on GitHub; this version of DynResManager contains also some useful functions for determining actual screen size of your device and real values of visible x/y boundaries. Next time I'll explain... More...

Posted by mmagrilov, Posted on 1 Oct 2011, Last updated 7 Nov 2011 | 7 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

4 votes
Improved Interactive Line Drawing to Physics Body

A proof of concept on how to draw a line and have it act as a physical body. I owe MichaelAssadi a huge debt of gratitude for posting his example, it was what got me started. More...

Posted by gander, Posted on 3 Sep 2011, Last updated 3 Sep 2011 | 6 comments

0 votes
Android Friendly splash screen logic

We used this logic to add a splash screen to Android. Useful for projects that don't use Director. 1 2 3 4 5 6 7 8 9 10 11 12 13 stateCounter=0 enterFrameListener=function(event)    stateCounter=stateCounter+1    if(stateCounter==1) then        --display our splash screen        splashScreenImage=display.newImageRect("Default-... More...

Posted by jflowers45, Posted on 1 Sep 2011, Last updated 1 Sep 2011 | 0 comments

1 vote
Using Sprite Sheets for Stationary Images

If you want to actually run this code you'll want to Download the full demo package Essentially, it shows a few tips for reducing memory usage using sprite sheets 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 require "sprite" require "rackSpriteSmall"   function cleanAll()         if (rows ~= nil) then                ... More...

Posted by jflowers45, Posted on 1 Sep 2011, Last updated 1 Sep 2011 | 1 comments

3 votes
Floating Keyboard

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 local newLabel = ... local keys = {}   keys["2"] = true   keys["3"] = true   keys["5"] = true   keys["7"] = true   keys[" "] = true   keys["X"] = true     require("Keyboard").... More...

Posted by bruno.simoes7, Posted on 1 Sep 2011, Last updated 1 Sep 2011 | 6 comments

0 votes
Picker UI

1 2 3 4 5 6 7 8 local picker = require("Picker") local function onSelect( value )    print("Selected value: " .. value)    return true end local types = {"char", "number", "number"} local pp = { scale = 1.3, width = display.contentWidth } picker.pickerFactory( "MyInstance", types, "... More...

Posted by bruno.simoes7, Posted on 1 Sep 2011, Last updated 1 Sep 2011 | 4 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

0 votes
Map with Dynamic Markers and Size

This code is a function that will take a table full of geographical coordinates and create a google map out of it with markers for all the table entries. The map will be centered and zoomed to fit all of the markers on screen, and if you like, you can include extra information in the table for each marker to have it displayed when the marker is tapped (typically a name and address). This works dynamically, so there... More...

Posted by w2md, Posted on 23 Aug 2011, Last updated 23 Aug 2011 | 1 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

2 votes
Easy Slider (SpringBoard) for Levelselect / HowTo ..

Simple Example (full working Code) how to make a Slider (Springboard) for your Level Selection or a HowTo Page where the User can slide through your Explanation. The Demo does use the "Director" Library to switch from one Scene to another and the "MovieClip" Library to show the SpringBoard Actual Page Circle DOWNLOAD I made additional Comments in the Code. Features: - Demo how to create an automatic Level Display (... More...

Posted by guruk, Posted on 12 Aug 2011, Last updated 12 Aug 2011 | 3 comments

1 vote
Thousands Separator for Large Numerical Strings

This will take in a number and outputs a string of that number with commas put in to mark the thousands. I took this from an old forum post and slightly altered it, but it seems like it would be more useful here in the code exchange. Hope it saves you a little time. Note: this will not work for numbers that are longer than 14 digits. Those will automatically be converted into scientific notation before entering the... More...

Posted by w2md, Posted on 11 Aug 2011, Last updated 11 Aug 2011 | 1 comments

0 votes
Simple Loading Screen

This is a simple loading screen logic which you can use if you are loading lots of graphics which slows down your game loading. This was asked by @fufuhwawa and I think this will be handy for others also. Note: This is just a sample to convey the idea so the screen won't look that impressive. 1 2 3 4 5 --creating main group all display objects will be loaded to it local mainGRP = display.newGroup()... More...

Posted by renvis@technowand, Posted on 11 Aug 2011, Last updated 11 Aug 2011 | 13 comments

1 vote
Enhanced "springboard" slide/photo viewer

New, enhanced "slider + springboard" module, to mimic standard iOS page flip functionality This module mimics the standard iOS "page springboard" for use in your own app. I designed it to resemble iOS as near as possible, so end users can instantly recognize the interface they use every day on their iOS phone or tablet. Also works for Android, of course. :) Features: More...

Posted by Ignis Design, Posted on 9 Aug 2011, Last updated 10 Aug 2011 | 33 comments

0 votes
Keeping score aligned

Hey, i don't know if someone has posted something similar to this, but I couldn't find one, so I wrote my own. If it's already out there somewhere, then sorry -- I just thought this could help the community. Basically, it is an external module that you require in to your code called length.lua. length.lua 1 2 3 4 5 6 7 8 9 10 11 12 13 module(..., package.seeall)   function width(y,t)  ... More...

Posted by mdcapps, Posted on 29 Jul 2011, Last updated 29 Jul 2011 | 7 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

1 vote
Vector Bitmap Masking; Snippet + App

Looking for a way to make vector based bitmap masks in Corona? Here you go. ;-) The ability isn't (currently) available without a little creative use of the tools already in the SDK. All the same, vector masking can be done with some added overhead. Here's a sample of the code needed to do it ... following the snippet is a full example app. 1 2 3 4     -- let's make a "mask" group for our... More...

Posted by kennw, Posted on 22 Jun 2011, Last updated 22 Jun 2011 | 2 comments

0 votes
Corona UI update

This update does the following: - fixes a bug in the CoronaUI that will has the overlay of the picker shifted to the right by 160 pixels. Found this was the case, when viewing the picker using iPad. - Added two new features to the Slider component. These are event listeners. One is for a text output and the other an integer. See main.lua for usage and demo. 1 2 3 4 local coronaUI = require( "coronaui... More...

Posted by keithmfoster7, Posted on 17 Jun 2011, Last updated 17 Jun 2011 | 0 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

1 vote
Date Picker Update

This is an update to the ConoraUI code base to add features to show the user a picker interface. As shown in the sample code, there is three pickers. Time, date, and a single column custom version. The sample code is documented, and if you have any questions, comment or email me. the new code for CoronaUI is at: https://public.me.com/ix/keithmfoster/CoronaUI.zip?disposition=download+1307806413935 sample usage -... More...

Posted by keithmfoster7, Posted on 11 Jun 2011, Last updated 11 Jun 2011 | 3 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

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

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

0 votes
RDX Layout Engine

Hi, We have created a simple layout engine in order to make our code more readable and have a clearer division of logic and presentation. It works based on descriptors that are created in the form of lua tables ( or remote JSON strings ). The engine then parses those descriptors and creates and position the actual display objects. It supports direct x and y coordinates as well as constraint based layout anchors such... More...

Posted by osvaldo_ros, Posted on 29 Apr 2011, Last updated 29 Apr 2011 | 2 comments

2 votes
Photoshop to Director.lua

This is a work in progress. I've been in the forums for a while and we've found it only works on 50% of the testers machines. I have yet to spot WHY those others don't get a successful output. Simply put this exporter will convert a layered PSD into LUA scenes (for Director.lua) and all the assets you need to build up a good starting block for any project. The GIT repository https://github.com/KevCJones/Photoshop-... More...

Posted by kevin.jones, Posted on 27 Apr 2011, Last updated 27 Apr 2011 | 3 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
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

1 vote
Preloader

Preloader is an extension to Ricardo Raubers famous Director Class. It allows you to add a loading screen to scene changes with long loading times. The principle is simple: We load a very light-weight loading screen as soon as the event hits to the user sees something is happening and doesn’t become agitated. From that loading screen, we then load the heavier actual scene we want. More...

Posted by 0x90, Posted on 29 Mar 2011, Last updated 29 Mar 2011 | 17 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

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

3 votes
Video Gallery

I’ve just posted the video gallery app template I’ve been working to Github. It includes a horizontal scroller (based on the vertical scroller in the sdk sample apps). This was the first app I created with Corona, so comments and critiques are definitely appreciated. Github repository: https://github.com/johnpolacek/Video-Gallery More...

Posted by johnpolacek, Posted on 3 Mar 2011, Last updated 3 Mar 2011 | 25 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

1 vote
Aligning Objects

I wrote a quick piece of code to help align objects to each other: More...

Posted by Jeff Johnson, Posted on 8 Jan 2010, Last updated 7 Oct 2010 | 1 comments