Event Listener


THE EVENT LISTENER

EventListener is the base struct from which all Event Listeners should inherit.

The EventListener struct contains information about the Object in which it was first created and the code to run when a specific event is triggered.

You should only create Event Listeners for the Object that has to "listen" for an event.

However, you can create multiple Event Listeners for the same Object to listen to multiple events at the same time.

CREATING AN EVENT LISTENER SCRIPT

Let's assume we want the instance color to turn red when the EventType.RedColor event is triggered.


HOW TO SETUP THE OBJECT

Create Event


Clean Up Event


Draw Event


REMARKS

You must Add() the Event Listener to the Event Manager when the Object has to listen to the event.

You must Remove() the Event Listener from the Event Manager when the Object no longer needs to listen to the event.

Get Giavapps Event System

Buy Now$9.99 USD or more