mirror of
https://github.com/OMGeeky/pytiled_parser.git
synced 2026-01-22 18:36:22 +01:00
Merge branch 'rf/caster' of github.com:Beefy-Swain/pytiled_parser into rf/caster
This commit is contained in:
@@ -4,14 +4,14 @@ from pytiled_parser import tileset
|
|||||||
|
|
||||||
EXPECTED = tileset.TileSet(
|
EXPECTED = tileset.TileSet(
|
||||||
columns=8,
|
columns=8,
|
||||||
image=Path(r"..\/..\/maps\/images\/tmw_desert_spacing.png"),
|
image=Path("../../maps/images/tmw_desert_spacing.png"),
|
||||||
image_height=199,
|
image_height=199,
|
||||||
image_width=265,
|
image_width=265,
|
||||||
margin=1,
|
margin=1,
|
||||||
spacing=1,
|
spacing=1,
|
||||||
name="tile_set_image",
|
name="tile_set_image",
|
||||||
tile_count=48,
|
tile_count=48,
|
||||||
tiled_version="1.3.1",
|
tiled_version="1.3.5",
|
||||||
tile_height=32,
|
tile_height=32,
|
||||||
tile_width=32,
|
tile_width=32,
|
||||||
version=1.2,
|
version=1.2,
|
||||||
|
|||||||
@@ -1,22 +1,21 @@
|
|||||||
{ "columns":8,
|
{
|
||||||
"editorsettings":
|
"columns": 8,
|
||||||
{
|
"editorsettings": {
|
||||||
"export":
|
"export": {
|
||||||
{
|
"format": "",
|
||||||
"format":"",
|
"target": "."
|
||||||
"target":"."
|
}
|
||||||
}
|
},
|
||||||
},
|
"image": "../../maps/images/tmw_desert_spacing.png",
|
||||||
"image":"..\/..\/maps\/images\/tmw_desert_spacing.png",
|
"imageheight": 199,
|
||||||
"imageheight":199,
|
"imagewidth": 265,
|
||||||
"imagewidth":265,
|
"margin": 1,
|
||||||
"margin":1,
|
"name": "tile_set_image",
|
||||||
"name":"tile_set_image",
|
"spacing": 1,
|
||||||
"spacing":1,
|
"tilecount": 48,
|
||||||
"tilecount":48,
|
"tiledversion": "1.3.5",
|
||||||
"tiledversion":"1.3.5",
|
"tileheight": 32,
|
||||||
"tileheight":32,
|
"tilewidth": 32,
|
||||||
"tilewidth":32,
|
"type": "tileset",
|
||||||
"type":"tileset",
|
"version": 1.2
|
||||||
"version":1.2
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -5,14 +5,14 @@ from pytiled_parser.common_types import Color
|
|||||||
|
|
||||||
EXPECTED = tileset.TileSet(
|
EXPECTED = tileset.TileSet(
|
||||||
columns=8,
|
columns=8,
|
||||||
image=Path(r"..\/..\/maps\/images\/tmw_desert_spacing.png"),
|
image=Path("../../maps/images/tmw_desert_spacing.png"),
|
||||||
image_height=199,
|
image_height=199,
|
||||||
image_width=265,
|
image_width=265,
|
||||||
margin=1,
|
margin=1,
|
||||||
spacing=1,
|
spacing=1,
|
||||||
name="tile_set_image",
|
name="tile_set_image",
|
||||||
tile_count=48,
|
tile_count=48,
|
||||||
tiled_version="1.3.1",
|
tiled_version="1.3.5",
|
||||||
tile_height=32,
|
tile_height=32,
|
||||||
tile_width=32,
|
tile_width=32,
|
||||||
version=1.2,
|
version=1.2,
|
||||||
|
|||||||
@@ -1,23 +1,16 @@
|
|||||||
{ "backgroundcolor":"#5500ff",
|
{
|
||||||
"columns":8,
|
"backgroundcolor": "#5500ff",
|
||||||
"editorsettings":
|
"columns": 8,
|
||||||
{
|
"image": "../../maps/images/tmw_desert_spacing.png",
|
||||||
"export":
|
"imageheight": 199,
|
||||||
{
|
"imagewidth": 265,
|
||||||
"format":"",
|
"margin": 1,
|
||||||
"target":"..\/image"
|
"name": "tile_set_image",
|
||||||
}
|
"spacing": 1,
|
||||||
},
|
"tilecount": 48,
|
||||||
"image":"..\/images\/tmw_desert_spacing.png",
|
"tiledversion": "1.3.5",
|
||||||
"imageheight":199,
|
"tileheight": 32,
|
||||||
"imagewidth":265,
|
"tilewidth": 32,
|
||||||
"margin":1,
|
"type": "tileset",
|
||||||
"name":"tile_set_image",
|
"version": 1.2
|
||||||
"spacing":1,
|
}
|
||||||
"tilecount":0,
|
|
||||||
"tiledversion":"1.3.5",
|
|
||||||
"tileheight":32,
|
|
||||||
"tilewidth":32,
|
|
||||||
"type":"tileset",
|
|
||||||
"version":1.2
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -5,14 +5,14 @@ from pytiled_parser.common_types import Color
|
|||||||
|
|
||||||
EXPECTED = tileset.TileSet(
|
EXPECTED = tileset.TileSet(
|
||||||
columns=8,
|
columns=8,
|
||||||
image=Path(r"..\/..\/maps\/images\/tmw_desert_spacing.png"),
|
image=Path("../../maps/images/tmw_desert_spacing.png"),
|
||||||
image_height=199,
|
image_height=199,
|
||||||
image_width=265,
|
image_width=265,
|
||||||
margin=1,
|
margin=1,
|
||||||
spacing=1,
|
spacing=1,
|
||||||
name="tile_set_image",
|
name="tile_set_image",
|
||||||
tile_count=48,
|
tile_count=48,
|
||||||
tiled_version="1.3.1",
|
tiled_version="1.3.5",
|
||||||
tile_height=32,
|
tile_height=32,
|
||||||
tile_width=32,
|
tile_width=32,
|
||||||
version=1.2,
|
version=1.2,
|
||||||
|
|||||||
20
tests/test_data/tilesets/image_tile_offset/expected.py
Normal file
20
tests/test_data/tilesets/image_tile_offset/expected.py
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
from pytiled_parser import tileset
|
||||||
|
from pytiled_parser.common_types import Color, OrderedPair
|
||||||
|
|
||||||
|
EXPECTED = tileset.TileSet(
|
||||||
|
columns=8,
|
||||||
|
image=Path("../../maps/images/tmw_desert_spacing.png"),
|
||||||
|
image_height=199,
|
||||||
|
image_width=265,
|
||||||
|
margin=1,
|
||||||
|
spacing=1,
|
||||||
|
name="tile_set_image",
|
||||||
|
tile_count=48,
|
||||||
|
tiled_version="1.3.5",
|
||||||
|
tile_height=32,
|
||||||
|
tile_width=32,
|
||||||
|
version=1.2,
|
||||||
|
tile_offset=OrderedPair(3, 5),
|
||||||
|
)
|
||||||
27
tests/test_data/tilesets/image_tile_offset/tileset.json
Normal file
27
tests/test_data/tilesets/image_tile_offset/tileset.json
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{ "columns":8,
|
||||||
|
"editorsettings":
|
||||||
|
{
|
||||||
|
"export":
|
||||||
|
{
|
||||||
|
"format":"",
|
||||||
|
"target":"..\/image"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"image":"..\/..\/maps\/images\/tmw_desert_spacing.png",
|
||||||
|
"imageheight":199,
|
||||||
|
"imagewidth":265,
|
||||||
|
"margin":1,
|
||||||
|
"name":"tile_set_image",
|
||||||
|
"spacing":1,
|
||||||
|
"tilecount":48,
|
||||||
|
"tiledversion":"1.3.5",
|
||||||
|
"tileheight":32,
|
||||||
|
"tileoffset":
|
||||||
|
{
|
||||||
|
"x":3,
|
||||||
|
"y":5
|
||||||
|
},
|
||||||
|
"tilewidth":32,
|
||||||
|
"type":"tileset",
|
||||||
|
"version":1.2
|
||||||
|
}
|
||||||
@@ -13,7 +13,13 @@ TEST_DATA = TESTS_DIR / "test_data"
|
|||||||
TILE_SETS = TEST_DATA / "tilesets"
|
TILE_SETS = TEST_DATA / "tilesets"
|
||||||
|
|
||||||
|
|
||||||
ALL_TILESET_DIRS = TILE_SETS.glob("*")
|
ALL_TILESET_DIRS = [
|
||||||
|
TILE_SETS / "image",
|
||||||
|
TILE_SETS / "image_background_color",
|
||||||
|
TILE_SETS / "image_properties",
|
||||||
|
TILE_SETS / "image_transparent_color",
|
||||||
|
TILE_SETS / "image_tile_offset",
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("tileset_dir", ALL_TILESET_DIRS)
|
@pytest.mark.parametrize("tileset_dir", ALL_TILESET_DIRS)
|
||||||
|
|||||||
Reference in New Issue
Block a user