SpriteSheet class

Sprite sheet for managing multiple sprites from one image

Constructors

SpriteSheet({required Image image, required int spriteWidth, required int spriteHeight, int spacing = 0, int margin = 0})
Create a sprite sheet

Properties

hashCode → int
The hash code for this object.
no setterinherited
image → Image
The sheet image
final
margin → int
Margin around the sheet
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
spacing → int
Spacing between sprites
final
spriteCount → int
Get number of sprites
no setter
spriteHeight → int
Height of each sprite
final
spriteWidth → int
Width of each sprite
final

Methods

getSprite(int index, {Vector3? position, double rotation = 0.0, double scale = 1.0, int layer = 0}) → Sprite
Get a sprite at a specific index
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

fromAsset(String assetPath, {required int spriteWidth, required int spriteHeight, int spacing = 0, int margin = 0}) → Future<SpriteSheet>
Load a sprite sheet from assets