javascript - If the CreateJS library supports the JSON output formats of Texture Packer -


i'd been using createjs little time. got trouble load image made texture packer, , got json file this:

{"frames": [  { "filename": "aim_dot", "frame": {"x":118,"y":4,"w":76,"h":76}, "rotated": false, "trimmed": false, "spritesourcesize": {"x":0,"y":0,"w":76,"h":76}, "sourcesize": {"w":76,"h":76} }, { "filename": "boundary", "frame": {"x":4,"y":385,"w":250,"h":100}, "rotated": false, "trimmed": false, "spritesourcesize": {"x":0,"y":0,"w":250,"h":100}, "sourcesize": {"w":250,"h":100} }]  } 

when bitmap represents image this:

 var bitmap = new createjs.bitmap("imagepath.jpg"); 

but if image image sprites,could use bitmap css sprite?

you should take @ spritesheet-class: http://www.createjs.com/docs/easeljs/classes/spritesheet.html

in texturepacker can chose easeljs output format, json can used easeljs spritesheet without further modifications. way generate easeljs spritesheets spritesheet.js (https://www.npmjs.com/package/spritesheet-js-monkiki-fork).


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -