Image constructor

Image({
  1. required Texture texture,
  2. required Rect<int> sourceRect,
  3. double pivotX = 0.5,
  4. double pivotY = 0.5,
})

Creates an Image instance.

  • texture: The source Texture.
  • sourceRect: The rectangle defining the portion of the texture to use.
  • pivotX: The normalized horizontal pivot point (defaults to 0.5).
  • pivotY: The normalized vertical pivot point (defaults to 0.5).

Implementation

Image({required this.texture, required this.sourceRect, this.pivotX = 0.5, this.pivotY = 0.5}) {
  texture.retain();
}