-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added example for loading animation config from json file
Signed-off-by: Scott Westover <[email protected]>
- Loading branch information
1 parent
b567882
commit ce91974
Showing
5 changed files
with
6,544 additions
and
0 deletions.
There are no files selected for viewing
172 changes: 172 additions & 0 deletions
172
examples/load-and-create-animations-with-json/assets/data/animations.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
{ | ||
"anims": [ | ||
{ | ||
"key": "npc_1_walk_down", | ||
"type": "frame", | ||
"frames": [ | ||
{ | ||
"frame": 0 | ||
}, | ||
{ | ||
"frame": 1 | ||
}, | ||
{ | ||
"frame": 2 | ||
}, | ||
{ | ||
"frame": 1 | ||
} | ||
], | ||
"defaultTextureKey": "characters", | ||
"frameRate": 6, | ||
"repeat": -1 | ||
}, | ||
{ | ||
"key": "npc_2_walk_down", | ||
"type": "frame", | ||
"frames": [ | ||
{ | ||
"frame": 3 | ||
}, | ||
{ | ||
"frame": 4 | ||
}, | ||
{ | ||
"frame": 5 | ||
}, | ||
{ | ||
"frame": 4 | ||
} | ||
], | ||
"defaultTextureKey": "characters", | ||
"frameRate": 6, | ||
"repeat": -1 | ||
}, | ||
{ | ||
"key": "npc_3_walk_down", | ||
"type": "frame", | ||
"frames": [ | ||
{ | ||
"frame": 6 | ||
}, | ||
{ | ||
"frame": 7 | ||
}, | ||
{ | ||
"frame": 8 | ||
}, | ||
{ | ||
"frame": 7 | ||
} | ||
], | ||
"defaultTextureKey": "characters", | ||
"frameRate": 6, | ||
"repeat": -1 | ||
}, | ||
{ | ||
"key": "npc_4_walk_down", | ||
"type": "frame", | ||
"frames": [ | ||
{ | ||
"frame": 9 | ||
}, | ||
{ | ||
"frame": 10 | ||
}, | ||
{ | ||
"frame": 11 | ||
}, | ||
{ | ||
"frame": 10 | ||
} | ||
], | ||
"defaultTextureKey": "characters", | ||
"frameRate": 6, | ||
"repeat": -1 | ||
}, | ||
{ | ||
"key": "walk_down", | ||
"type": "frame", | ||
"frames": [ | ||
{ | ||
"frame": 54 | ||
}, | ||
{ | ||
"frame": 55 | ||
}, | ||
{ | ||
"frame": 56 | ||
}, | ||
{ | ||
"frame": 55 | ||
} | ||
], | ||
"defaultTextureKey": "characters", | ||
"frameRate": 6, | ||
"repeat": -1 | ||
}, | ||
{ | ||
"key": "walk_left", | ||
"type": "frame", | ||
"frames": [ | ||
{ | ||
"frame": 66 | ||
}, | ||
{ | ||
"frame": 67 | ||
}, | ||
{ | ||
"frame": 68 | ||
}, | ||
{ | ||
"frame": 67 | ||
} | ||
], | ||
"defaultTextureKey": "characters", | ||
"frameRate": 6, | ||
"repeat": -1 | ||
}, | ||
{ | ||
"key": "walk_right", | ||
"type": "frame", | ||
"frames": [ | ||
{ | ||
"frame": 78 | ||
}, | ||
{ | ||
"frame": 79 | ||
}, | ||
{ | ||
"frame": 80 | ||
}, | ||
{ | ||
"frame": 79 | ||
} | ||
], | ||
"defaultTextureKey": "characters", | ||
"frameRate": 6, | ||
"repeat": -1 | ||
}, | ||
{ | ||
"key": "walk_up", | ||
"type": "frame", | ||
"frames": [ | ||
{ | ||
"frame": 90 | ||
}, | ||
{ | ||
"frame": 91 | ||
}, | ||
{ | ||
"frame": 92 | ||
}, | ||
{ | ||
"frame": 91 | ||
} | ||
], | ||
"defaultTextureKey": "characters", | ||
"frameRate": 6, | ||
"repeat": -1 | ||
} | ||
] | ||
} |
Binary file added
BIN
+24.1 KB
examples/load-and-create-animations-with-json/assets/images/characters.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.