Image class Graphics

A drawable image, typically a sub-region of a Texture.

An Image defines a specific rectangular area (sourceRect) within a larger Texture, along with pivot points for rotation and scaling.

Constructors

Image({required Texture texture, required Rect<int> sourceRect, double pivotX = 0.5, double pivotY = 0.5})
Creates an Image instance.

Properties

flags int
The flags associated with the texture. See TextureFlags.
no setter
hashCode int
The hash code for this object.
no setterinherited
height int
The height of the image, derived from sourceRect.
no setter
isLoading bool
Indicates if the texture is still loading.
no setter
pivotX double
The horizontal pivot point of the image, normalized (0.0 to 1.0).
getter/setter pair
pivotY double
The vertical pivot point of the image, normalized (0.0 to 1.0).
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sourceRect Rect<int>
The rectangular region within the texture of this image.
final
texture Texture
The Texture that this image uses.
final
width int
The width of the image, derived from sourceRect.
no setter

Methods

dispose() → dynamic
Disposes the image texture.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

loadFrames({required Texture texture, required int frameWidth, required int frameHeight, int paddingX = 0, int paddingY = 0, double pivotX = 0.5, double pivotY = 0.5}) Images
Loads multiple frames from a single Texture (sprite sheet).