JoystickDirectional constructor

JoystickDirectional({
  1. Future<Sprite>? spriteBackgroundDirectional,
  2. Future<Sprite>? spriteKnobDirectional,
  3. bool isFixed = true,
  4. EdgeInsets margin = const EdgeInsets.all(100),
  5. Alignment alignment = Alignment.bottomLeft,
  6. double size = 80,
  7. Color color = Colors.blueGrey,
  8. bool enableDiagonalInput = true,
})

Implementation

JoystickDirectional({
  Future<Sprite>? spriteBackgroundDirectional,
  Future<Sprite>? spriteKnobDirectional,
  this.isFixed = true,
  this.margin = const EdgeInsets.all(100),
  this.alignment = Alignment.bottomLeft,
  this.size = 80,
  this.color = Colors.blueGrey,
  this.enableDiagonalInput = true,
}) {
  _loader?.add(AssetToLoad(spriteBackgroundDirectional, (value) {
    _backgroundSprite = value;
  }));

  _loader?.add(AssetToLoad(spriteKnobDirectional, (value) {
    _knobSprite = value;
  }));

  _tileSize = size / 2;
}