-
Notifications
You must be signed in to change notification settings - Fork 10
/
phaser2.inja
37 lines (37 loc) · 1.38 KB
/
phaser2.inja
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{
"meta": { {% set scale=first(textures).scale %}
"app": "https://github.com/houmain/spright",
"image": "{{ first(textures).filename }}",
"size": { "w": {{ first(textures).width }}, "h": {{ first(textures).height }} },
"scale": {{ scale }}
},
"frames": [
## for sprite in sprites
{
"filename": "{{ sprite.id }}",
"rotated": {{ sprite.rotated }},
"trimmed": {% if sprite.rect.w == sprite.trimmedRect.w and sprite.rect.h == sprite.trimmedRect.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.trimmedRect.x * scale, 0) }},
"y": {{ round(sprite.trimmedRect.y * scale, 0) }},
"w": {{ round(sprite.trimmedRect.w * scale, 0) }},
"h": {{ round(sprite.trimmedRect.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
]
}