mirror of
https://github.com/OMGeeky/pytiled_parser.git
synced 2025-12-26 17:02:28 +01:00
Test for template with a collection of images tileset
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
|
||||
18
tests/test_data/map_tests/template/template_tile_image.json
Normal file
18
tests/test_data/map_tests/template/template_tile_image.json
Normal file
@@ -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"
|
||||
}
|
||||
24
tests/test_data/map_tests/template/tileset_single_image.json
Normal file
24
tests/test_data/map_tests/template/tileset_single_image.json
Normal file
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user