Skip to content

Instantly share code, notes, and snippets.

@rkusa
Last active August 29, 2015 14:04
Show Gist options
  • Save rkusa/1942a2daf53f2f196acd to your computer and use it in GitHub Desktop.
Save rkusa/1942a2daf53f2f196acd to your computer and use it in GitHub Desktop.
Custom Zwoptex 2 coordinates JSON template.
---
name: JSON
extension: json
---
{
"frames": {
{% for sprite in spritesAndAliases %}
"{{ sprite.pathName }}": {
"frame": {"x":{{ sprite.textureRect.x }},"y":{{ sprite.textureRect.y }},"w":{{ sprite.textureRect.width }},"h":{{ sprite.textureRect.height }}},
"rotated": false,
"trimmed": {% if sprite.trimmed %}true{% else %}false{% /if %},
"spriteSourceSize": {"x":0,"y":0,"w":{{ sprite.sourceSize.width }},"h":{{ sprite.sourceSize.height }}},
"sourceSize": {"w":{{ sprite.sourceSize.width }},"h":{{ sprite.sourceSize.height }}},
"spriteColorRect": {"x":{{ sprite.sourceColorRect.x }},"y":{{ sprite.sourceColorRect.y }},"w":{{ sprite.sourceColorRect.width }},"h":{{ sprite.sourceColorRect.height }}},
"spriteOffset": {"x":{{ sprite.offset.x }}, "y":{{ sprite.offset.y }}}
}{% unless loop.last %},{% endunless %}
{% /for %}
},
"meta": {
"app": "http://zwoptexapp.com",
"version": "{{ metadata.version }}",
"name": "{{ metadata.name }}",
"image": "{{ sheet.textureFile.name }}",
"size": {"w":{{ sheet.size.width }},"h":{{ sheet.size.height }}},
"scale": "{{ target.scale }}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment