How to Use Custom Events in Corona

A little over a year ago (in June of 2011), I went over the Corona Event Model, and explained exactly what events are in Corona, when they occur, and how you can “hook” into them to take advantage of some of Corona’s best features.

However, in the previous article, I kept the subject-matter focused on the built-in events associated with specific API’s that are provided out-of-the-box in Corona. What I didn’t mention is that you can define your own custom events, and have objects listen for when those events are dispatched (which you have complete control over as well).

This tutorial will walk you through defining and dispatching custom events, so you can begin applying the knowledge to your own games and apps.

Guided Tour of Corona’s API Reference

This week’s tutorial is going to be a little different. Rather than go over yet another awesome Corona feature, I’ll instead be walking you through another aspect of Corona development that’s arguably just as important (if not more important) than any one specific feature of the SDK. What you’ll be learning about today is something you’ll undoubtedly use in every single Corona project you work on, and that is of course is the Corona SDK API Reference.

Tutorial: Handling Corona System Events

When developing applications, it’s important to handle scenarios that occur as a result of the user interacting with your game in as many different ways possible. It’s equally as important to handle scenarios that occur as a result of “system” events, whether they are explicitly triggered by the user or not. Things that immediately come […]

Tutorial: Property Callbacks

If you know what events are Corona (if you don’t, you should start here), then you know that they allow you to “do something” whenever a specific action that corresponds to an event occurs. You can even define your own actions, and dispatch custom events whenever it is appropriate for your app. However, no events […]