Joystick constructor

Joystick({
  1. dynamic id,
  2. List<JoystickAction> actions = const [],
  3. JoystickDirectional? directional,
  4. PlayerControllerListener? observer,
})

Class responsable to adds a joystick controller in your game. If pass oberver this param, the joystick will controll this observer and not the Component passed in player param.

Implementation

Joystick({
  super.id,
  this.actions = const [],
  JoystickDirectional? directional,
  PlayerControllerListener? observer,
}) {
  _directional = directional;
  if (observer != null) {
    addObserver(observer);
  }
}