Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: SensorCollisionHandler

[17:7] extends: FxObj

Wraps FXGL's SensorCollisionHandler abstract base (com.almasb.fxgl.physics.SensorCollisionHandler) via the AussomSensorCollisionHandler Java bridge. Use it to react to trigger-zone enters / overlaps / exits without going through the full CollisionHandler pipeline. Attach via PhysicsComponent.addSensor(hitBox, this.obj).

Methods

  • SensorCollisionHandler ()

    Creates a new SensorCollisionHandler.

  • adopt (object Ajo)

    Wraps an existing handler AussomJavaObject.

  • onCollisionBegin (callback Cb)

    Sets the begin callback. Receives the other Entity.

    • @p Cb is a callback (otherEntity) -> any.
  • onCollision (callback Cb)

    Sets the active callback. Receives the other Entity each tick that the trigger remains overlapping.

  • onCollisionEnd (callback Cb)

    Sets the end callback. Receives the other Entity when the trigger overlap ends.