Basics
Guides
API Reference
Basics
Guides
API Reference
[25:7] extends: FxObj
Wraps FXGL's EventBuilder
(com.almasb.fxgl.dsl.EventBuilder), the fluent setup for
firing a JavaFX Event onto the FXGL EventBus on a timer + a
condition. Construct via fxgl.eventBuilder().
Wiring:
eb = fxgl.eventBuilder();
eb.interval(durationAjo)
.whenCondition(::shouldFire)
.limit(5)
.thenRun(::doIt)
.buildAndStart();
Returns a TimerAction AJO that callers can later expire.
EventBuilder (Ajo = null)
Wraps an existing EventBuilder AussomJavaObject (the usual entry, since
fxgl.eventBuilder()returns a wrapper with the AJO already populated).
Ajo is an optional AussomJavaObject around an EventBuilder.adopt (object Ajo)
Wraps an existing EventBuilder AussomJavaObject.
interval (object DurationAjo)
Sets the interval between event fires. Default is zero (fire on every game tick).
DurationAjo is a javafx.util.Duration AJO (e.g. aji.invokeStaticRaw("javafx.util.Duration","seconds",1.0)).whenCondition (callback Cb)
Sets the predicate that decides whether to fire on each eligible tick. Named
whenConditionrather thanwhento keep the call site free of reserved-word ambiguity in future Aussom grammars; matches FXGL'swhen(...)method.
Cb is a callback () -> bool.limit (int Times)
Sets the maximum number of events to emit before the underlying TimerAction expires. Must be > 0.
thenRun (callback Cb)
Runs the given callback every time the condition fires. (Under the hood FXGL still pushes a FunctionCallEvent onto the EventBus, so global event listeners stay coherent.)
Cb is a callback () -> void.thenFire (object EventAjo)
Fires the given JavaFX Event each time the condition is met.
EventAjo is a javafx.event.Event AJO.thenFireSupplier (callback Cb)
Fires the event produced by the supplier each time the condition is met (use this form when each fire should carry fresh data).
Cb is a callback () -> javafx.event.Event AJO.buildAndStart ()
Starts the timer using the running game's EventBus + Timer and returns the TimerAction AJO.
buildAndStartOn (object EventBusObj, object TimerObj)
Starts the timer against an explicit EventBus + Timer.
EventBusObj is an EventBus wrapper (or raw AJO).TimerObj is a Timer wrapper (or raw AJO).
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.