mirror of
https://github.com/OMGeeky/pytiled_parser.git
synced 2025-12-26 17:02:28 +01:00
tests(layer): First layer test with no compression or encoding completed
This commit is contained in:
@@ -1,3 +1,97 @@
|
||||
from pytiled_parser import common_types, layer
|
||||
from pathlib import Path
|
||||
|
||||
EXPECTED = [layer.TileLayer(name="Tile Layer 1", opacity=1, visible=True)]
|
||||
from pytiled_parser import common_types, layer, tiled_object
|
||||
|
||||
EXPECTED = [
|
||||
layer.TileLayer(
|
||||
name="Tile Layer 1",
|
||||
opacity=1,
|
||||
visible=True,
|
||||
id=1,
|
||||
size=common_types.Size(8, 6),
|
||||
data=[
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
17,
|
||||
18,
|
||||
19,
|
||||
20,
|
||||
21,
|
||||
22,
|
||||
23,
|
||||
24,
|
||||
25,
|
||||
26,
|
||||
27,
|
||||
28,
|
||||
29,
|
||||
30,
|
||||
31,
|
||||
32,
|
||||
33,
|
||||
34,
|
||||
35,
|
||||
36,
|
||||
37,
|
||||
38,
|
||||
39,
|
||||
40,
|
||||
41,
|
||||
42,
|
||||
43,
|
||||
44,
|
||||
45,
|
||||
46,
|
||||
47,
|
||||
48,
|
||||
],
|
||||
),
|
||||
layer.LayerGroup(
|
||||
name="Group 1",
|
||||
opacity=1,
|
||||
visible=True,
|
||||
id=4,
|
||||
layers=[
|
||||
layer.ObjectLayer(
|
||||
name="Object Layer 1",
|
||||
opacity=1,
|
||||
visible=True,
|
||||
id=2,
|
||||
draw_order="topdown",
|
||||
tiled_objects=[
|
||||
tiled_object.Rectangle(
|
||||
id=1,
|
||||
name="",
|
||||
rotation=0,
|
||||
size=common_types.Size(69.3333333333333, 52.6666666666667),
|
||||
coordinates=common_types.OrderedPair(46.3333333333333, 39),
|
||||
visible=True,
|
||||
type="",
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
layer.ImageLayer(
|
||||
name="Image Layer 1",
|
||||
opacity=1,
|
||||
visible=True,
|
||||
id=3,
|
||||
image=Path("../../images/tile_04.png"),
|
||||
transparent_color=common_types.Color("#000000"),
|
||||
),
|
||||
]
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
{ "compressionlevel":-1,
|
||||
"editorsettings":
|
||||
{
|
||||
"export":
|
||||
{
|
||||
"target":"."
|
||||
}
|
||||
},
|
||||
"height":6,
|
||||
"infinite":false,
|
||||
"layers":[
|
||||
@@ -14,42 +21,54 @@
|
||||
"x":0,
|
||||
"y":0
|
||||
},
|
||||
{
|
||||
"draworder":"topdown",
|
||||
"id":2,
|
||||
"name":"Object Layer 1",
|
||||
"objects":[],
|
||||
"opacity":1,
|
||||
"type":"objectgroup",
|
||||
"visible":true,
|
||||
"x":0,
|
||||
"y":0
|
||||
},
|
||||
{
|
||||
"id":3,
|
||||
"image":"",
|
||||
"name":"Image Layer 1",
|
||||
"opacity":1,
|
||||
"type":"imagelayer",
|
||||
"visible":true,
|
||||
"x":0,
|
||||
"y":0
|
||||
},
|
||||
{
|
||||
"id":4,
|
||||
"layers":[],
|
||||
"layers":[
|
||||
{
|
||||
"draworder":"topdown",
|
||||
"id":2,
|
||||
"name":"Object Layer 1",
|
||||
"objects":[
|
||||
{
|
||||
"height":52.6666666666667,
|
||||
"id":1,
|
||||
"name":"",
|
||||
"rotation":0,
|
||||
"type":"",
|
||||
"visible":true,
|
||||
"width":69.3333333333333,
|
||||
"x":46.3333333333333,
|
||||
"y":39
|
||||
}],
|
||||
"opacity":1,
|
||||
"type":"objectgroup",
|
||||
"visible":true,
|
||||
"x":0,
|
||||
"y":0
|
||||
}],
|
||||
"name":"Group 1",
|
||||
"opacity":1,
|
||||
"type":"group",
|
||||
"visible":true,
|
||||
"x":0,
|
||||
"y":0
|
||||
},
|
||||
{
|
||||
"id":3,
|
||||
"image":"..\/..\/images\/tile_04.png",
|
||||
"name":"Image Layer 1",
|
||||
"opacity":1,
|
||||
"transparentcolor":"#000000",
|
||||
"type":"imagelayer",
|
||||
"visible":true,
|
||||
"x":0,
|
||||
"y":0
|
||||
}],
|
||||
"nextlayerid":5,
|
||||
"nextobjectid":1,
|
||||
"nextobjectid":3,
|
||||
"orientation":"orthogonal",
|
||||
"renderorder":"right-down",
|
||||
"tiledversion":"1.3.1",
|
||||
"tiledversion":"1.4.1",
|
||||
"tileheight":32,
|
||||
"tilesets":[
|
||||
{
|
||||
@@ -58,6 +77,6 @@
|
||||
}],
|
||||
"tilewidth":32,
|
||||
"type":"map",
|
||||
"version":1.2,
|
||||
"version":1.4,
|
||||
"width":8
|
||||
}
|
||||
Reference in New Issue
Block a user