GameObject constructor

GameObject({
  1. required Vector2 position,
  2. required Vector2 size,
  3. required FutureOr<Sprite>? sprite,
  4. Vector2? positionFromTarget,
  5. LightingConfig? lightingConfig,
  6. int? objectPriority,
  7. double angle = 0,
  8. Anchor anchor = Anchor.topLeft,
  9. bool renderAboveComponents = false,
})

Implementation

GameObject({
  required Vector2 position,
  required Vector2 size,
  required FutureOr<Sprite>? sprite,
  Vector2? positionFromTarget,
  LightingConfig? lightingConfig,
  this.objectPriority,
  double angle = 0,
  Anchor anchor = Anchor.topLeft,
  bool renderAboveComponents = false,
}) {
  this.renderAboveComponents = renderAboveComponents;
  this.anchor = anchor;
  this.position = position;
  this.size = size;
  this.angle = angle;
  loader?.add(AssetToLoad(sprite, (value) => this.sprite = value));
  setupLighting(lightingConfig);
}