• Home
  • About Jason
  • Apps
    • Dentist Bird: A West African Folktale
    • Social Poetry
    • Spanish School Bus
    • Chungaboo Language Series
    • Gordon & Li Li:
      Learn Animals in Mandarin
    • Corban Walker: Ireland at Venice 2011
  • Corona SDK Resources
  • Client Testimonials
  • Contact

Posts in category Corona SDK Resources

Stripe Plugin for Corona SDK

Feb22
2016
19 Comments Written by Jason

   

I created the Stripe plugin for Corona SDK to give Corona developers an easy way to accept online payments from inside their apps with as little as a single line of code.

This page contains the documentation for the plugin, as well as a sample project you can download and run to see the plugin in action for yourself. Please check back, as I will continue to update this page whenever bug fixes or new features are added. READ MORE »

Tagged bank, corona, credit card, payments, plugin, stripe

Twitter Plugin for Corona SDK

Jul15
2015
42 Comments Written by Jason

   

I created the Twitter plugin for Corona SDK to give Corona developers an easy way to access the full range of Twitter’s REST APIs from inside their apps, making it simple to get data from or post information to a Twitter user’s account with as little as a single line of code. The plugin automatically handles oAuth authentication, and persistently saves a logged-in user’s token data, so they’ll only need to log in and authorize your app once, even across multiple sessions, until they are manually logged out or revoke your app’s access to their Twitter account. The plugin also comes with a set of “convenience functions” that return Lua tables and/or Corona display objects, for easier access to common-use applications without the need for developers to wade through the raw JSON data that Twitter’s REST APIs return.

This page contains the documentation for the plugin, as well as a sample project you can download and run to see the plugin in action for yourself. Please check back, as I will continue to update this page whenever bug fixes or new features are added. READ MORE »

Tagged corona, plugin, twitter

Timer 2.0 Library for Corona SDK

Feb25
2015
20 Comments Written by Jason

I recently commented on a post on the Corona Labs forum from a developer who was having a hard time with timers that were not canceled when a scene was changed. Now the Corona SDK already gives us methods for pausing, resuming, or even canceling active timers, but those methods are somewhat restricted in that you can only cancel one timer at a time, and you must refer to the timer by it’s handle to do so. Under the current system, it’s very easy to accidentally leave a timer running when you would rather pause or cancel all your timers, or at least a number of them.

In my comment on that forum post, I suggested that the original poster vote up a Corona SDK feature request for the timer library to receive an update akin to the “Transition 2.0” update from a few years ago, so that we would have the ability to pause/resume/cancel all active timers at once, or to pause/resume/cancel a subset of active timers by tagging them. I still think that’s worth doing, and if you’re reading this, then you should definitely do that! However, part of what I love about Corona is how we developers can roll our own solutions to these sorts of problems while we wait for Corona Labs to add new features or fix bugs – so I decided to do just that and “fix” the timer library to enable those requested features. READ MORE »

Corona Finger Paint Module Revisited

Feb17
2015
3 Comments Written by Jason

   

Almost a year ago I posted a free module that allows Corona SDK developers to add a finger painting “canvas” to their Corona projects with just one line of code. It seems to have been useful for a number of developers, but in the months since releasing it, opportunities for improvement have presented themselves, and in particular I received one specific feature request that seemed worth addressing. So I dusted off that old module and made some tweaks that resulted in what I’m calling fingerPaint version 1.5.

What’s New In Version 1.5
  1. I’ve updated the syntax for calling fingerPaint.newCanvas() so that you now pass a single table with specific key/value pairs into the function. This is partly because I find this to be a better way to organize function arguments, but also because it’s in-line with the syntax in my more popular progressRing module (as well as most official Corona SDK APIs). I’ve included backwards compatibility, however, so version 1.5 of the module will play nice with projects that use the older syntax.
  2. I added a new “how to use this module” section at the top of fingerPaint.lua. That’s something I did for the progressRing module that folks seemed to like, so I’ll be doing that with all my publicly-shared modules moving forward.
  3. I modified the module so that a paint stroke is only extended if the user’s finger has traveled far enough for it to make a visible difference. Previously, you could occasionally get an erratic line if the user “squiggled” their finger too closely around a single point.
  4. I added the option to break up a stroke into individual line segments instead of using a single line object and appending new line points. By default this option is disabled, because it can lead to potentially crash-inducing memory usage if left unchecked, as it requires substantially more display objects to keep in system memory. But in certain controlled circumstances this option can be useful — for example, if you want the user to be able to erase only part of an existing paint stroke. I’ve also heard reports that on certain Android devices the default method of appending to a single line object can result in erratic behavior. In those cases, using segmented strokes seems to fix things. To enable this feature, simply add the key/value pair “segmented = true” to the table you pass into fingerPaint.newCanvas().
How To Use The Module

For more information about how the module works and it’s history, you can check out the original post from 2014 – I’m not going to recreate that information here. But below is a step-by-step guide for using the module to add a finger paint canvas to your app, with the updated syntax. This same information is also included in a commented-out section at the top of the module’s lua file. READ MORE »

Progress Ring Module for Corona SDK

Dec21
2014
51 Comments Written by Jason

progressRing

   

UPDATE #3 (3/4/2015): Fixed a bug that caused a “completed” event to be triggered upon creating the progress ring. Now “completed” events will only be triggered by ring:goTo() calls made after the ring’s creation. Thanks to Nick for finding this mistake and pointing it out in the comments!

UPDATE #2 (1/23/2015): Fixed a bug that only manifests in Corona SDK build #2015.2544 and later. In build #2015.2544, Corona Labs fixed the finalize() bug that prevented objects’ finalize events from being triggered when their parent display group was removed. I had utilized a brilliant workaround developed by Sergey Lerg, but there was an error in my implementation of his fix that caused a crash when run on build 2015.2544 and later. I fixed that crash by adding a 1ms timer when checking to see if finalize events are being triggered as they should. The fix is not necessary for up-to-date Corona builds, but I’m leaving it in for folks who might be running legacy Corona builds.

UPDATE #1 (1/7/2015): The progressRing module has been updated to ensure that the procedurally-generated mask image reliably meets the requirements for mask images. Previously, it didn’t always work when running on devices whose screen size did not match up with the content width/height defined in an app’s config.lua file.

Something that is occasionally asked about on the Corona Labs forums is how to achieve a circular progress indicator (what I call a “progress ring”). The uses for this type of widget are limitless, but here are a few examples:

  • player/enemy health bars in a RTS-style game (see Ravenmark)
  • countdown timer to show when a player’s turn is up in a turn-based multiplayer or puzzle game
  • a more visually interesting percentage indicator than the usual horizontal or vertical bar (in a business app)

A number of solutions have been proposed in the forums, often involving the use of sprite objects with X number of frames to cycle through depending on the position of the progress bar. These solutions can work, of course, but I set out to create my own progress ring solution with the following goals in mind:

  • The movement of the progress ring should be seamless and smooth, regardless of which direction it was moving and/or how quickly (something that can’t happen with sprite-based solutions unless you use a prohibitively high number of frames)
  • The progress ring must be created solely with code, so that it can be modularized into a single lua file and added to a project with one line of code (again, something that isn’t possible with sprite-based solutions).
  • The progress ring must be visually customizable through code: colors, size, depth of the “donut hole” (or no donut hole at all), stroke width, etc.
  • A progress ring object must have simple and easy-to-use methods for controlling it after it’s been created.

And I’m happy to report that I’ve come up with a solution that meets all those requirements and makes it very easy to add a progressRing to any Corona project with just one line of code! READ MORE »

« Older Entries

Please Do Not Feed The Developers

The Corona SDK tutorials, modules and code snippets that I post on this site are free for you to use, with no expectation of repayment. But a few kind souls have told me that they wanted to toss me a few bucks as a way of saying "thanks," so I've added this donation button. If you like what I'm doing here, and wanted to contribute, feel free. And if not, that's cool too. I'm just glad you're here.

Jason on GitHub

Jason on Twitter


© 2011–2018 Jason Schroeder  ·  Admin Login
QR Code Business Card