Hello,
since the new Version 1.2.0 of Tiles the jsons are a ittle different and throwing a crash when loaded in APP:
"tiledversion":"1.1.6": <--- working one
"properties":
{
"friction":0.5,
"restitution":"0"
},
"propertytypes":
{
"friction":"float",
"restitution":"string"
},
"tiledversion":"1.2.0": <--- not working
"properties":[
{
"name":"friction",
"type":"float",
"value":0.5
},
{
"name":"restitution",
"type":"string",
"value":"0"
}],
By manually modifying the non-working JSON to the structure of the working one, it works at once!
Any clue how I can tell Tiles that it shall create the JSON according to the necessary structure?
here the Log when crashes:
Logger connected to: HTC HTC One_M8 dual sim
--------- beginning of crash
--------- beginning of main
Copying updated assets files (2)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Skipping tile set: textures
Error occurred on line: 121 (X2TileMap)
java.lang.ClassCastException: java.util.ArrayList cannot be cast to anywheresoftware.b4a.objects.collections.Map$MyMap
at b4a.example.x2tilemap._parseobjectslayer(x2tilemap.java:2159)
at b4a.example.x2tilemap._initialize(x2tilemap.java:279)
at b4a.example.game._initialize(game.java:79)
at b4a.example.main._activity_create(main.java:383)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:738)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:360)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:260)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at b4a.example.main.afterFirstLayout(main.java:104)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:168)
at android.app.ActivityThread.main(ActivityThread.java:5845)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687)
** Activity (main) Resume **
from Tile http://docs.mapeditor.org/en/stable/reference/json-map-format/
Changelog
Tiled 1.2
since the new Version 1.2.0 of Tiles the jsons are a ittle different and throwing a crash when loaded in APP:
"tiledversion":"1.1.6": <--- working one
"properties":
{
"friction":0.5,
"restitution":"0"
},
"propertytypes":
{
"friction":"float",
"restitution":"string"
},
"tiledversion":"1.2.0": <--- not working
"properties":[
{
"name":"friction",
"type":"float",
"value":0.5
},
{
"name":"restitution",
"type":"string",
"value":"0"
}],
By manually modifying the non-working JSON to the structure of the working one, it works at once!
Any clue how I can tell Tiles that it shall create the JSON according to the necessary structure?
here the Log when crashes:
Logger connected to: HTC HTC One_M8 dual sim
--------- beginning of crash
--------- beginning of main
Copying updated assets files (2)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Skipping tile set: textures
Error occurred on line: 121 (X2TileMap)
java.lang.ClassCastException: java.util.ArrayList cannot be cast to anywheresoftware.b4a.objects.collections.Map$MyMap
at b4a.example.x2tilemap._parseobjectslayer(x2tilemap.java:2159)
at b4a.example.x2tilemap._initialize(x2tilemap.java:279)
at b4a.example.game._initialize(game.java:79)
at b4a.example.main._activity_create(main.java:383)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:738)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:360)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:260)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at b4a.example.main.afterFirstLayout(main.java:104)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:168)
at android.app.ActivityThread.main(ActivityThread.java:5845)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687)
** Activity (main) Resume **
from Tile http://docs.mapeditor.org/en/stable/reference/json-map-format/
Changelog
Tiled 1.2
- Added nextlayerid to the Map object.
- Added id to the Layer object.
- The tiles in a Tileset are now stored as an array instead of an object. Previously the tile IDs were stored as string keys of the “tiles” object, now they are stored as id property of each Tileobject.
- Custom tile properties are now stored within each Tile instead of being included astileproperties in the Tileset object.
- Custom properties are now stored in an array instead of an object where the property names were the keys. Each property is now an object that stores the name, type and value of the property. The separate propertytypes and tilepropertytypes attributes have been removed.
- Added a chunked data format, currently used for infinite maps.
- Templates were added. Templates can be stored as JSON files with an Object Template object.
- Tilesets can now contain Wang tiles. They are saved in the new Wang Set object (since Tiled 1.1.