Wiki

Clone wiki

Fairlight / Event-System

Event-System

Fairlight provides a powerful and flexible yet easy-to-use Event-System. Various Interfaces can be implemented to listen to specific Events. The associated callback-methods can be used to add your custom behavior code.

The Event-Systems consists of various parts.

EventManager

You can add multiple EventHandlers to the EventManager. When you use the EventManager to register components he will take care of adding them to all related EventHandlers. The EventManager is also used to fire (custom) Events.

Eventhandler

You can use some of the predefined Eventhandlers or implement your own ones. This makes this system so flexible and powerful. For example are there separate Eventhandlers for Update-,Render- and Touch-Events. Only those you use and add to your EventManager will be handled. You can also easily add your own Handlers for custom Events.

Here are some examples of how the Event-System can be used:

Updated