InterfaceComponent constructor

InterfaceComponent({
  1. required int id,
  2. required Vector2 position,
  3. required Vector2 size,
  4. Future<Sprite>? spriteUnselected,
  5. Future<Sprite>? spriteSelected,
  6. bool selectable = false,
  7. ValueChanged<bool>? onTapComponent,
})

Implementation

InterfaceComponent({
  required this.id,
  required Vector2 position,
  required Vector2 size,
  Future<Sprite>? spriteUnselected,
  Future<Sprite>? spriteSelected,
  this.selectable = false,
  this.onTapComponent,
}) {
  loader?.add(AssetToLoad(spriteUnselected, (value) {
    this.spriteUnselected = value;
  }));
  loader?.add(AssetToLoad(spriteSelected, (value) {
    this.spriteSelected = value;
  }));
  this.position = Vector2(position.x, position.y);
  this.size = size;
}