mirror of
https://github.com/OMGeeky/pytiled_parser.git
synced 2025-12-29 07:40:11 +01:00
Add support for transformations in Tilesets. Closes #37
This commit is contained in:
25
tests/test_data/tilesets/image_transformations/expected.py
Normal file
25
tests/test_data/tilesets/image_transformations/expected.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from pathlib import Path
|
||||
|
||||
from pytiled_parser import tileset
|
||||
|
||||
EXPECTED = tileset.Tileset(
|
||||
columns=8,
|
||||
image=Path("../../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.6.0",
|
||||
tile_height=32,
|
||||
tile_width=32,
|
||||
transformations=tileset.Transformations(
|
||||
hflip=True,
|
||||
vflip=False,
|
||||
prefer_untransformed=False,
|
||||
rotate=False,
|
||||
),
|
||||
version="1.6",
|
||||
type="tileset",
|
||||
)
|
||||
21
tests/test_data/tilesets/image_transformations/tileset.json
Normal file
21
tests/test_data/tilesets/image_transformations/tileset.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{ "columns":8,
|
||||
"image":"..\/..\/images\/tmw_desert_spacing.png",
|
||||
"imageheight":199,
|
||||
"imagewidth":265,
|
||||
"margin":1,
|
||||
"name":"tile_set_image",
|
||||
"spacing":1,
|
||||
"tilecount":48,
|
||||
"tiledversion":"1.6.0",
|
||||
"tileheight":32,
|
||||
"tilewidth":32,
|
||||
"transformations":
|
||||
{
|
||||
"hflip":true,
|
||||
"preferuntransformed":false,
|
||||
"rotate":false,
|
||||
"vflip":false
|
||||
},
|
||||
"type":"tileset",
|
||||
"version":"1.6"
|
||||
}
|
||||
Reference in New Issue
Block a user