Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: EntityWorldListener

[20:7] extends: FxObj

Wraps the AussomEntityWorldListener bridge (implementation of FXGL's EntityWorldListener interface) so Aussom code can be notified whenever entities are added to or removed from a GameWorld. Configure onAdded / onRemoved callbacks then pass the wrapper's .obj to GameWorld.addWorldListener. The existing GameWorld.addWorldListener convenience already builds one of these internally from a pair of callbacks; this wrapper is the explicit form when users want to keep a reference to the listener for later removeWorldListener.

Methods

  • EntityWorldListener (OnAdded = null, OnRemoved = null)

    Creates a new EntityWorldListener with optional onAdded and onRemoved callbacks. Each callback receives an Entity (wrapped if the Entity class is in scope, raw AJO otherwise).

    • @p OnAdded is the entity-added callback (or null).
    • @p OnRemoved is the entity-removed callback (or null).
  • adopt (object Ajo)

    Wraps an existing EntityWorldListener AussomJavaObject.

  • onEntityAdded (object EntityObj)

    Fires the registered onEntityAdded callback.

  • onEntityRemoved (object EntityObj)

    Fires the registered onEntityRemoved callback.