{"frames": { {% set scale=first(textures).scale %} ## for sprite in sprites "{{ sprite.id }}": { "rotated": {{ sprite.rotated }}, "trimmed": {% if sprite.sourceRect.w == sprite.trimmedSourceRect.w and sprite.sourceRect.h == sprite.trimmedSourceRect.h %}false{% else %}true{% endif %}, "sourceSize": { "w": {{ round(sprite.sourceRect.w * scale, 0) }}, "h": {{ round(sprite.sourceRect.h * scale, 0) }} }, "spriteSourceSize": { "x": {{ round(sprite.trimmedSourceRect.x * scale, 0) }}, "y": {{ round(sprite.trimmedSourceRect.y * scale, 0) }}, "w": {{ round(sprite.trimmedSourceRect.w * scale, 0) }}, "h": {{ round(sprite.trimmedSourceRect.h * scale, 0) }} }, "frame": { "x": {{ round(sprite.rect.x * scale, 0) }}, "y": {{ round(sprite.rect.y * scale, 0) }}, "w": {{ round(sprite.rect.w * scale, 0) }}, "h": {{ round(sprite.rect.h * scale, 0) }} }, "anchor": { "x": {{ sprite.pivot.x / sprite.rect.w }}, "y": {{ sprite.pivot.y / sprite.rect.h }} } }{% if not loop.is_last %},{% endif %} ## endfor }, ## if existsIn(tags, "anim") "animations": { ## for value, indices in tags.anim "{{ value }}": [{% for index in indices %}"{{ at(sprites, index).id }}"{% if not loop.is_last %}, {% endif %}{% endfor %}]{% if not loop.is_last %},{% endif %} ## endfor }, ## endif "meta": { "app": "https://github.com/houmain/spright", "format": "RGBA8888", "image": "{{ first(textures).filename }}", "size": { "w": {{ first(textures).width }}, "h": {{ first(textures).height }} }, "scale": {{ scale }} } }