diff --git a/tests/test_data/map_tests/template/expected.py b/tests/test_data/map_tests/template/expected.py index 5cab7fc..edcf117 100644 --- a/tests/test_data/map_tests/template/expected.py +++ b/tests/test_data/map_tests/template/expected.py @@ -35,15 +35,25 @@ EXPECTED = tiled_map.TiledMap( size=common_types.Size(32, 32), gid=30, ), + tiled_object.Tile( + id=5, + coordinates=common_types.OrderedPair(116, 145), + name="", + rotation=0, + type="", + visible=True, + size=common_types.Size(32, 32), + gid=1, + ), ], ) ], map_size=common_types.Size(8, 6), next_layer_id=3, - next_object_id=4, + next_object_id=6, orientation="orthogonal", render_order="right-down", - tiled_version="1.6.0", + tiled_version="1.7.1", tile_size=common_types.Size(32, 32), version="1.6", background_color=common_types.Color(255, 0, 4, 255), @@ -64,7 +74,30 @@ EXPECTED = tiled_map.TiledMap( tile_width=32, version="1.6", type="tileset", - ) + ), + 49: tileset.Tileset( + columns=0, + margin=0, + spacing=0, + name="tileset_single_image", + grid=tileset.Grid(orientation="orthogonal", width=1, height=1), + tiles={ + 0: tileset.Tile( + id=0, + image=Path(Path(__file__).parent / "../../images/tile_01.png") + .absolute() + .resolve(), + image_height=32, + image_width=32, + ) + }, + tile_count=1, + tiled_version="1.7.1", + tile_height=32, + tile_width=32, + type="tileset", + version="1.6", + ), }, properties={ "bool property - true": True, diff --git a/tests/test_data/map_tests/template/map.json b/tests/test_data/map_tests/template/map.json index c0b1b40..a29eb52 100644 --- a/tests/test_data/map_tests/template/map.json +++ b/tests/test_data/map_tests/template/map.json @@ -19,6 +19,12 @@ "template":"template_tile.json", "x":46.3682110303692, "y":112.993321292057 + }, + { + "id":5, + "template":"template_tile_image.json", + "x":116, + "y":145 }], "opacity":1, "type":"objectgroup", @@ -27,7 +33,7 @@ "y":0 }], "nextlayerid":3, - "nextobjectid":4, + "nextobjectid":6, "orientation":"orthogonal", "properties":[ { @@ -61,12 +67,16 @@ "value":"Hello, World!!" }], "renderorder":"right-down", - "tiledversion":"1.6.0", + "tiledversion":"1.7.1", "tileheight":32, "tilesets":[ { "firstgid":1, "source":"tileset.json" + }, + { + "firstgid":49, + "source":"tileset_single_image.json" }], "tilewidth":32, "type":"map", diff --git a/tests/test_data/map_tests/template/template_tile_image.json b/tests/test_data/map_tests/template/template_tile_image.json new file mode 100644 index 0000000..1267c02 --- /dev/null +++ b/tests/test_data/map_tests/template/template_tile_image.json @@ -0,0 +1,18 @@ +{ "object": + { + "gid":1, + "height":32, + "id":4, + "name":"", + "rotation":0, + "type":"", + "visible":true, + "width":32 + }, + "tileset": + { + "firstgid":1, + "source":"tileset_single_image.json" + }, + "type":"template" +} \ No newline at end of file diff --git a/tests/test_data/map_tests/template/tileset_single_image.json b/tests/test_data/map_tests/template/tileset_single_image.json new file mode 100644 index 0000000..c15990e --- /dev/null +++ b/tests/test_data/map_tests/template/tileset_single_image.json @@ -0,0 +1,24 @@ +{ "columns":0, + "grid": + { + "height":1, + "orientation":"orthogonal", + "width":1 + }, + "margin":0, + "name":"tileset_single_image", + "spacing":0, + "tilecount":1, + "tiledversion":"1.7.1", + "tileheight":32, + "tiles":[ + { + "id":0, + "image":"..\/..\/images\/tile_01.png", + "imageheight":32, + "imagewidth":32 + }], + "tilewidth":32, + "type":"tileset", + "version":"1.6" +} \ No newline at end of file