hello everyone,
(first i apologize if my english is not really good, i hope that it won’t impair understanding).
As i said in the title, I’m encountering a problem with objects created with tiled. Iused the function “createFromObject” of my map object and successfully created all my objects. But the parameters created in tiled are not implemented in my objects.
There is the concerned part of my JSon file:
{
"draworder":"topdown",
"id":2,
"name":"platform_simple",
"objects":[
{
"gid":2,
"height":20,
"id":11,
"name":"p_s",
"properties":[
{
"name":"nSize",
"type":"int",
"value":10
}],
"rotation":0,
"type":"",
"visible":true,
"width":79.9090909090909,
"x":0.0568181818178033,
"y":20000.0303030303
},
and i checked the part of the function “createFromObject” that implements the properties and that is:
https://github.com/photonstorm/phaser/blob/v2.6.2/src/tilemap/Tilemap.js#L458
for (var property in obj.properties)
{
group.set(sprite, property, obj.properties[property], false, false, 0, true);
}
and it seems that it is totally normal that it doesn’t work with my JSon file so i did a modified function by replacing this by:
for (var property in obj.properties)
{
group.set(sprite, obj.properties[property].name, obj.properties[property].value, false, false, 0, true);
}
And it works. So it appears that i have no problems but my question is:
Is my version of tiled wrong? Do i have any way to make Compatible JSon files for Phaser2?
I didn’t find much people talking about the parameters with tiled so i’m sorry if this question seems stupid.
Thank you for your answers