-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem Parsing JSON Sprite Sheet #56
Comments
What version of TP? v3 might have changed the json format Sent from my iPad On Dec 24, 2012, at 7:27 AM, jjsev [email protected] wrote:
|
Help --> About says "TexturePacker(Pro) 3.0.4" but I'm using the essential (lite) version. The generated json file itself says '"version": "1.0",' in the meta section. I put the whole json on pastebin at http://pastebin.com/zjNiiwQu |
Did you ever figure this out? I am having the same exact trouble. |
It looks like it's still outputting the old format where frames property is an array. It is now an object. I'm definitely using TP 3 but using the paid version - maybe there is a diff there |
Hi,
I'm trying to teach myself LimeJS to make a game with sprites, and since I'm not on a Mac, I decided to use TexturePacker and JSON instead of Zwoptex. As my first project I decided to recreate lime/demos/tests/frame4.js which is the game with the blue monsters.
I recreated the sprite sheet and published it as JSON (array), made it an asset with gensoy and updated, but when I tried the game, I got the error message (in Opera Dragonfly) that it couldn't find the frames. I did some snooping around, and it turned out the JS file generated by gensoy had this structure:
The file lime/src/helper/parser/json.js however says:
I.e., it's expecting the value of the "frames" key to be an associative array wherein the keys are filenames, but level 2 of the structure is actually a list. I changed dict[i] to dict[frame['filename']] on line 25 of json.js, and that solved the problem, and I was able to recreate the game with the blue monsters.
Now my question is whether this is a problem with how TexturePacker generates JSON files, how gensoy makes the assets, or how json.js parses the assets (in which case my solution would appear to be the correct fix).
Or did I just miss some vital step somewhere?
The text was updated successfully, but these errors were encountered: