SpriteImage constructor

SpriteImage({
  1. required Image sprite,
  2. Vector3? position,
  3. Rect? section,
  4. String name = '',
  5. Color color = const Color(0xffff0000),
})

Implementation

SpriteImage({
  required this.sprite,
  Vector3? position,
  Rect? section,
  this.name = '',
  this.color = const Color(0xffff0000),
}){
  this.section = section ?? Rect.fromLTWH(0, 0, sprite.width.toDouble(), sprite.height.toDouble());
  this.position = position ?? Vector3(0.0, 0.0, 0.0);
  savePosition();
}