UPDATE (2/17/2015): The fingerPaint module has been updated to version 1.5, with new features and updated syntax for the fingerPaint.newCanvas() function (though it is backwards-compatible with the older v1.0 syntax). The links on this page will download the updated version.
Click here for details on version 1.5.
In 2012 I programmed a fun little iPad app called Gordon & Li Li: Learn Animals in Mandarin, for which I needed the user to “draw” on the iPad with his or her finger. At the time, there was no clear established method for accomplishing this in Corona SDK (I’m still not sure there is one), and the closest bit of code I could find on the Corona forums didn’t really get the job done to my satisfaction. So I came up with my own solution that worked really well for my needs and shared it with the community on Corona’s Code Exchange. (You can view that original post here.)
Now that I’m posting Corona tutorials here, I thought I’d revisit that code, which at the time existed only as a simple main.lua file and convert it into a Lua module so that it could easily be plugged into any existing Corona project with just a single line of code. I also took it as an opportunity to clean up my code and make sure that it is fully compatible with Corona’s newer Graphics 2.0 APIs. If you need finger painting in your own app, feel free to download the module and plug it in. Or if you want to dig deeper and modify the code to suit your own needs, please do, and share your edits in the comments! I’m making it available under the standard MIT license, so do with it whatever you like.
Let’s Finger Paint!
I’ll dig into the module’s code further down in this post, but for those of you who just want to type in that “one line of code” I promised and get finger painting, here’s how: READ MORE »