Basics
Guides
API Reference
Basics
Guides
API Reference
[26:7] extends: FxObj
Wraps FXGL's ComponentListener two-method interface (com.almasb.fxgl.entity.component.ComponentListener). Fires onAdded(component) when a Component is added to the entity it's watching, and onRemoved(component) when one is removed. Backed by AussomComponentListener because the interface has two methods (aji.closure only handles single-method functional interfaces). Register the listener via Entity.addComponentListener(listener.obj). Example: listener = new ComponentListener(::onAdded, ::onRemoved); e.addComponentListener(listener.obj); public onAdded(component) { ... } public onRemoved(component) { ... }
ComponentListener (callback OnAdded = null, callback OnRemoved = null)
Creates a new ComponentListener with the given Aussom callbacks. Either may be null to ignore that event class.
OnAdded is a callback (component) -> any.OnRemoved is a callback (component) -> any.adopt (object Ajo)
Wraps an existing ComponentListener AussomJavaObject.
onAdded (object ComponentObj)
Triggers the onAdded callback. The engine normally drives this when a Component is attached to an Entity that has the listener registered.
onRemoved (object ComponentObj)
Triggers the onRemoved callback.

Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.