Sprite class

Constructors

Sprite(String fileName, {double x: 0.0, double y: 0.0, double width, double height})
Sprite.fromImage(Image image, {double x: 0.0, double y: 0.0, double width, double height})

Properties

image ↔ Image
read / write
originalSize Position
read-only
paint Paint
read / write
size Position
read-only
src Rect
read / write
hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

loaded() → bool
render(Canvas canvas, {double width, double height, Paint overridePaint}) → void
renderCentered(Canvas canvas, Position p, {Position size, Paint overridePaint}) → void
Renders this sprite centered in the position p, i.e., on p - size / 2. [...]
renderPosition(Canvas canvas, Position p, {Position size, Paint overridePaint}) → void
renderRect(Canvas canvas, Rect dst, {Paint overridePaint}) → void
renderScaled(Canvas canvas, Position p, {double scale: 1.0, Paint overridePaint}) → void
Renders this Sprite on the position p, scaled by the scale factor provided. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited

Static Methods

loadSprite(String fileName, {double x: 0.0, double y: 0.0, double width, double height}) → Future<Sprite>