Hello, I was working with the JSON format trying to create physics bodies from the Tile Collision Editor. I was having a difficult time trying to figure out how to get the correct positions for the polyline since it always starts a (0, 0). I noticed in the TMX file, the Object
contains an x and y value that I should use as the starting position to add to the polyline point values. However, the Object
x and y information is not in the JSON export, making it impossible to get the correct positions of the polylines. Here is an example of the data I’m seeing. Perhaps, Im missing something?
TMX:
<tile id="54" terrain=",,,5">
<image width="64" height="64" source="tiles@1x/IronMinesTerrain-54.png"/>
<objectgroup draworder="index">
<object id="0" x="63.8813" y="33.2256">
<polyline points="0,0 -28.82,-0.183567 -28.82,30.8393"/>
</object>
</objectgroup>
</tile>
JSON:
"id":54,
"image":"..\/Documents\/Programming\/Flarts-SK\/Artwork\/Levels\/IronMines\/tiles@1x\/IronMinesTerrain-54.png",
"imageheight":64,
"imagewidth":64,
"objectgroup":
{
"draworder":"index",
"name":"",
"objects":[
{
"height":0,
"name":"",
"polyline":[
{
"x":0,
"y":0
},
{
"x":-28.82,
"y":-0.183567
},
{
"x":-28.82,
"y":30.8393
}],
"rotation":0,
"type":"",
"visible":true,
"width":0
}],
"opacity":1,
"type":"objectgroup",
"visible":true,
"x":0,
"y":0
},
"terrain":[-1, -1, -1, 5]
Thanks for your help!