phaser/v2-community/resources/PhysicsEditor Exporter/phaser.json
2016-11-23 00:17:46 +00:00

15 lines
No EOL
941 B
JSON
Executable file

{{% for body in bodies %}{% if not forloop.first %},{% endif %}
"{% if global.name_prefix %}{{global.name_prefix}}/{% endif %}{{body.name}}": [{% for fixture in body.fixtures %}{% if not forloop.first %},{% endif %}
{
{% if fixture.fixtureKey %}"fixtureKey": "{{fixture.fixtureKey}}",
{% endif %}"isSensor": {{fixture.isSensor}},
"filter": { "group": {{fixture.filter_groupIndex}}, "categoryBits": {{fixture.filter_categoryBits}}, "maskBits": {{fixture.filter_maskBits}} },
{% if fixture.isCircle %}"circle": {
"radius": {{fixture.radius|floatformat:3}},
"position": [ {{fixture.center.x|floatformat:3}}, {{fixture.center.y|floatformat:3}} ]
}{% else %}"polygons":[ {% for polygon in fixture.polygons %}{% if not forloop.first %},{% endif %}
[ {% for point in polygon %}{% if not forloop.first %} , {% endif %} {{point.x}}, {{point.y}} {% endfor %} ]{% endfor %}
]{% endif %}
}{% endfor %}
]{% endfor %}
}