GridSheetAtlasParser class

Parses the engine's older "grid sheet" animation JSON, so files written for the retired AnimatedSpriteComponent still play:

{
  "meta":  { "image": "hero.png", "frameWidth": 32, "frameHeight": 32,
             "columns": 4, "rows": 2 },
  "clips": { "run":  { "frames": [0, 1, 2, 3], "fps": 12, "loop": true },
             "idle": { "row": 1, "start": 0, "end": 1 } }
}

Every cell becomes a region named by its index ("0", "1", …), and a clip's fps becomes the same duration on each of its frames. The file never named its image — the component did — so without meta.image the sheet is taken to sit beside the JSON with the same name and .png; imageFallback supplies that name.

Inheritance

Constructors

GridSheetAtlasParser({String imageFallback = 'sheet.png'})
A parser that assumes the sheet image is imageFallback (sheet.png by default) when the JSON's meta.image does not name it.

Properties

hashCode → int
The hash code for this object.
no setterinherited
imageFallback → String
The sheet image's file name, in the JSON's folder, used when meta.image is missing. AtlasParser.detect passes the JSON's own name with .png.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse(Map<String, dynamic> json, String basePath) → Future<SpriteAtlas>
Parse json into a SpriteAtlas.
override
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

matches(Map<String, dynamic> json) → bool
Whether json is a grid sheet: a frame size and no frames.