Skip to content
Daan van Yperen edited this page Aug 2, 2014 · 6 revisions

Listeners

Checklist:

  • Public
  • Annotated with @Subscribe
  • Exactly one parameter derived from Event class.
@Subscribe
public void myCustomListener( MyEvent event )
{
   ..
}

Listeners in Systems or Managers

Provided the EventManager is part of your World, all listeners on systems and managers are be automatically registered upon world initialization.

Systems or managers added after the fact must be manually registered.

Listeners on other objects

Listeners on an object outside Artemis are supported. They are resolved with the active ListenerFinderStrategy.

eventManager.registerEvents(myObject);