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

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

Methods

loaded() bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
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. [...]
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(Object 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>