Basics
Guides
API Reference
Basics
Guides
API Reference
[16:7] extends: FxObj
Wraps FXGL's StateMachine
(com.almasb.fxgl.core.fsm.StateMachine), a generic FSM
container with a single parent state plus a queue of optional
substates. Pair with the State wrapper (or any
AussomState-implementing AJO) to drive gameplay phases, AI,
menu transitions.
StateMachine (object InitialState)
Creates a new StateMachine with the given initial state.
InitialState is a State wrapper (or AJO implementing StategetParentState ()
Returns the current parent state as an AJO.
getCurrentState ()
Returns the current state (substate if any, else parent).
getActiveStates ()
Returns the active states as an AussomJavaObject around a CopyOnWriteArrayList.
isInHierarchy (object StateObj)
Returns true when State is in the parent-or-substate hierarchy.
changeState (object NewState)
Transitions to the new state. If newState.isSubState the state is pushed; otherwise it replaces the parent state.
popSubState ()
Pops the topmost substate. Returns true when a substate was popped, false when no substate was active.
runOnActiveStates (callback Action)
Calls Action(state) for every currently-active state.
Action is a callback (stateAjo) -> void.this object
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.