SpriteSheet class
A sprite sheet packs a number of smaller images into a single large image.
The placement of the smaller images are defined by a json file. The larger image and json file is typically created by a tool such as TexturePacker. The SpriteSheet class will take a reference to a larger image and a json string. From the image and the string the SpriteSheet creates a number of SpriteTexture objects. The names of the frames in the sprite sheet definition are used to reference the different textures.
Constructors
- SpriteSheet({required Image image, required String jsonDefinition})
-
Creates a new sprite sheet from an
_image
and a sprite sheetjsonDefinition
.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- image → Image
-
The image used by the sprite sheet.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
textures
→ Map<
String, SpriteTexture> -
Returns a map containing the textures of this sprite sheet.
no setter
Methods
-
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
-
operator [](
String fileName) → SpriteTexture? - Returns a texture by its name.