Basics
Guides
API Reference
Basics
Guides
API Reference
[17:7] extends: FxObj
Wraps FXGL's Timer service that drives every TimerAction in a scene. Aussom users construct a Timer (or obtain the engine timer through fxgl.getGameTimer in chunk 6) and schedule callbacks with runOnceAfter (single-shot delay) or runAtInterval (repeating). Each scheduling call returns a TimerAction the caller can pause / resume / expire later.
Timer (Ajo = null)
Creates a Timer wrapper. With no argument constructs a new FXGL Timer; with an AussomJavaObject wraps an existing one (used by fxgl.getGameTimer).
Ajo is an optional AussomJavaObject around an FXGL Timer.adopt (object Ajo)
Wraps an existing Timer AussomJavaObject.
Ajo is an AussomJavaObject around an FXGL Timer.A new wrapper.runOnceAfter (callback Cb, double Seconds)
Schedules a callback to run after the given delay in seconds.
Cb is a callback with no arguments.Seconds is the delay before firing.A TimerAction wrapper.runAtInterval (callback Cb, double Seconds)
Schedules a callback to run every Seconds, indefinitely.
Cb is a callback with no arguments.Seconds is the interval between firings.A TimerAction wrapper.runAtIntervalLimited (callback Cb, double Seconds, int Limit)
Schedules a callback to run every Seconds for Limit total firings, after which the TimerAction expires.
Cb is a callback with no arguments.Seconds is the interval.Limit is the total number of firings.A TimerAction wrapper.newLocalTimer ()
Returns a new LocalTimer for capture / elapsed checks.
A LocalTimer wrapper.update (double Tpf)
Drives the timer one tick forward. Normally called by the scene; available for manual driving in tests.
Tpf is the elapsed time in seconds.this objectgetNow ()
Returns the accumulated elapsed time in seconds since the Timer started.
A double in seconds.clear ()
Cancels every scheduled TimerAction.
this objectrunAtIntervalWhile (callback Cb, double Seconds, object ConditionObj)
Schedules a callback to run every Seconds for as long as the supplied BooleanProperty stays true. Useful for "fire while shield up" style mechanics.
Cb is the callback (no arguments).Seconds is the interval.ConditionObj is an AussomJavaObject around a ReadOnlyBooleanProperty.A TimerAction wrapper.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.