Basics
Guides
API Reference
Basics
Guides
API Reference
[30:7] extends: FxObj
Wraps FXGL's Action abstract class (com.almasb.fxgl.entity.action.Action), the base unit of work an ActionComponent runs. An Action is bound to a single Entity and exposes lifecycle hooks (onQueued / onStarted / onUpdate / onCompleted / onCancelled). The engine calls onUpdate(tpf) each frame the action is current; the action ends when setComplete() is called from inside it or cancel() is called from outside. Backed by AussomAction (Java bridge) because Action is abstract and has multiple overridable methods (aji.closure only handles single-method functional interfaces). Example: public update(tpf) { // move toward target, setComplete() when arrived } a = new Action(::update); ac.addAction(a.obj);
Action (callback OnUpdate = null, callback OnQueued = null, callback OnStarted = null, callback OnCompleted = null, callback OnCancelled = null)
Creates a new Action with the given lifecycle callbacks. The onUpdate callback receives the per-tick time (double). The other hooks take no arguments. All callbacks may be null.
OnUpdate is a callback (tpf) -> any.OnQueued is a callback () -> any.OnStarted is a callback () -> any.OnCompleted is a callback () -> any.OnCancelled is a callback () -> any.adopt (object Ajo)
Wraps an existing Action AussomJavaObject.
getEntity ()
Returns the Entity AJO the action is bound to (or null).
setEntity (object EntityObj)
Binds the action to an Entity. Normally the ActionComponent does this when the action is queued.
EntityObj is an Entity or its AJO.isComplete ()
Returns true if the action has signaled completion.
setComplete ()
Marks the action complete; the engine will dequeue it.
isCancelled ()
Returns true if the action has been cancelled.
cancel ()
Cancels the action; the engine will dequeue it.

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