Skip to content

Commit 0ec7941

Browse files
committed
Test for template with a collection of images tileset
1 parent e77f15c commit 0ec7941

File tree

4 files changed

+90
-5
lines changed

4 files changed

+90
-5
lines changed

tests/test_data/map_tests/template/expected.py

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,25 @@
3535
size=common_types.Size(32, 32),
3636
gid=30,
3737
),
38+
tiled_object.Tile(
39+
id=5,
40+
coordinates=common_types.OrderedPair(116, 145),
41+
name="",
42+
rotation=0,
43+
type="",
44+
visible=True,
45+
size=common_types.Size(32, 32),
46+
gid=1,
47+
),
3848
],
3949
)
4050
],
4151
map_size=common_types.Size(8, 6),
4252
next_layer_id=3,
43-
next_object_id=4,
53+
next_object_id=6,
4454
orientation="orthogonal",
4555
render_order="right-down",
46-
tiled_version="1.6.0",
56+
tiled_version="1.7.1",
4757
tile_size=common_types.Size(32, 32),
4858
version="1.6",
4959
background_color=common_types.Color(255, 0, 4, 255),
@@ -64,7 +74,30 @@
6474
tile_width=32,
6575
version="1.6",
6676
type="tileset",
67-
)
77+
),
78+
49: tileset.Tileset(
79+
columns=0,
80+
margin=0,
81+
spacing=0,
82+
name="tileset_single_image",
83+
grid=tileset.Grid(orientation="orthogonal", width=1, height=1),
84+
tiles={
85+
0: tileset.Tile(
86+
id=0,
87+
image=Path(Path(__file__).parent / "../../images/tile_01.png")
88+
.absolute()
89+
.resolve(),
90+
image_height=32,
91+
image_width=32,
92+
)
93+
},
94+
tile_count=1,
95+
tiled_version="1.7.1",
96+
tile_height=32,
97+
tile_width=32,
98+
type="tileset",
99+
version="1.6",
100+
),
68101
},
69102
properties={
70103
"bool property - true": True,

tests/test_data/map_tests/template/map.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
"template":"template_tile.json",
2020
"x":46.3682110303692,
2121
"y":112.993321292057
22+
},
23+
{
24+
"id":5,
25+
"template":"template_tile_image.json",
26+
"x":116,
27+
"y":145
2228
}],
2329
"opacity":1,
2430
"type":"objectgroup",
@@ -27,7 +33,7 @@
2733
"y":0
2834
}],
2935
"nextlayerid":3,
30-
"nextobjectid":4,
36+
"nextobjectid":6,
3137
"orientation":"orthogonal",
3238
"properties":[
3339
{
@@ -61,12 +67,16 @@
6167
"value":"Hello, World!!"
6268
}],
6369
"renderorder":"right-down",
64-
"tiledversion":"1.6.0",
70+
"tiledversion":"1.7.1",
6571
"tileheight":32,
6672
"tilesets":[
6773
{
6874
"firstgid":1,
6975
"source":"tileset.json"
76+
},
77+
{
78+
"firstgid":49,
79+
"source":"tileset_single_image.json"
7080
}],
7181
"tilewidth":32,
7282
"type":"map",
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{ "object":
2+
{
3+
"gid":1,
4+
"height":32,
5+
"id":4,
6+
"name":"",
7+
"rotation":0,
8+
"type":"",
9+
"visible":true,
10+
"width":32
11+
},
12+
"tileset":
13+
{
14+
"firstgid":1,
15+
"source":"tileset_single_image.json"
16+
},
17+
"type":"template"
18+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{ "columns":0,
2+
"grid":
3+
{
4+
"height":1,
5+
"orientation":"orthogonal",
6+
"width":1
7+
},
8+
"margin":0,
9+
"name":"tileset_single_image",
10+
"spacing":0,
11+
"tilecount":1,
12+
"tiledversion":"1.7.1",
13+
"tileheight":32,
14+
"tiles":[
15+
{
16+
"id":0,
17+
"image":"..\/..\/images\/tile_01.png",
18+
"imageheight":32,
19+
"imagewidth":32
20+
}],
21+
"tilewidth":32,
22+
"type":"tileset",
23+
"version":"1.6"
24+
}

0 commit comments

Comments
 (0)