Skip to main content

UIAxisEventListener

Receives axis value updates from UI controls like joysticks and driving wheel.

Create in the Editor

  1. Ensure there is a UIController in the scene.
  2. Create a GameObject and add UIRect.
  3. Add the UIAxisEventListener component.

How to Use

  1. Get the component with myObject.findComponent(UIAxisEventListener.class).
  2. Read and write the component properties to control behavior.
  3. Test input or layout in Play mode.

Java Example

SpatialObject myObject = /* your object */;
UIAxisEventListener comp = myObject.findComponent(UIAxisEventListener.class);
if (comp != null) {
// set the axisName value:
comp.axisName = "value";
// read the axisName value:
String axisNameValue = comp.axisName;

// set the value value:
comp.value = new Vector2(1, 1);
// read the value value:
Vector2 valueValue = comp.value;

}