-
Notifications
You must be signed in to change notification settings - Fork 10
/
phaser.inja
47 lines (47 loc) · 1.62 KB
/
phaser.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
38
39
40
41
42
43
44
45
46
47
{
"meta": {
"app": "https://github.com/houmain/spright"
},
"textures": [
## for texture in textures
{ {% set scale=texture.scale %}
"image": "{{ texture.filename }}",
"format": "RGBA8888",
"size": {
"w": {{ texture.width }},
"h": {{ texture.height }}
},
"scale": {{ scale }},
"frames": [
## for index in texture.spriteIndices
{ {% set sprite=at(sprites, index) %}
"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
]
}
## endfor
]
}