Basics
Guides
API Reference
Basics
Guides
API Reference
[22:7] extends: Parent
Wraps an AussomVirtualJoystick (subclass of FXGL's abstract VirtualJoystick) so Aussom code can build a custom on-screen analog joystick. Register onGetCenter (returns a Point2D wrapper) and onGetMaxDistance (returns a double); add the background and thumb shapes via the standard JavaFX Parent API on this.obj. Example: vj = new VirtualJoystick(fxgl.getInput()); vj.onGetCenter(::center).onGetMaxDistance(::max);
VirtualJoystick (InputAjo)
Creates a new VirtualJoystick bridge.
InputAjo is an Input wrapper or AussomJavaObject.adopt (object Ajo)
Wraps an existing AussomVirtualJoystick AussomJavaObject.
onGetCenter (callback Cb)
Registers the getCenter callback (returns the joystick center as a Point2D wrapper).
Cb is a callback () -> Point2D.this objectonGetMaxDistance (callback Cb)
Registers the getMaxDistance callback (returns max distance from center to joystick edge as a double).
Cb is a callback () -> double.this objectgetMaxForce ()
Returns the maxForce scalar applied at the edge.
setMaxForce (double Force)
Sets the maxForce scalar applied at the edge.
Force is a double.this objectgetVector ()
Returns the normalized vector from center to pointer.
getVectorWithForce ()
Returns the force-scaled vector from center to pointer.
vectorProperty ()
Returns the read-only Point2D vector property.
vectorWithForceProperty ()
Returns the read-only Point2D vectorWithForce property.
getCenter ()
Returns the joystick's center as a javafx.geometry.Point2D AJO. The bridge dispatches through the on-create-view callback when registered.

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