File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed
tests/test_data/layer_tests/all_layer_types Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ class Layer:
56
56
visible : bool
57
57
58
58
coordinates : OrderedPair = OrderedPair (0 , 0 )
59
+ parallax_factor : OrderedPair = OrderedPair (1 , 1 )
59
60
60
61
id : Optional [int ] = None
61
62
size : Optional [Size ] = None
@@ -195,6 +196,8 @@ class RawLayer(TypedDict):
195
196
objects : List [tiled_object .RawTiledObject ]
196
197
offsetx : float
197
198
offsety : float
199
+ parallaxx : float
200
+ parallaxy : float
198
201
opacity : float
199
202
properties : List [properties_ .RawProperty ]
200
203
startx : int
@@ -350,6 +353,11 @@ def _get_common_attributes(raw_layer: RawLayer) -> Layer:
350
353
if raw_layer .get ("properties" ) is not None :
351
354
common_attributes .properties = properties_ .cast (raw_layer ["properties" ])
352
355
356
+ if raw_layer .get ("parallaxx" ) is not None :
357
+ common_attributes .parallax_factor = OrderedPair (
358
+ raw_layer ["parallaxx" ], raw_layer ["parallaxy" ]
359
+ )
360
+
353
361
return common_attributes
354
362
355
363
Original file line number Diff line number Diff line change 10
10
id = 1 ,
11
11
size = common_types .Size (8 , 6 ),
12
12
offset = common_types .OrderedPair (1 , 3 ),
13
+ parallax_factor = common_types .OrderedPair (1.4 , 1.3 ),
13
14
properties = {
14
15
"test" : "test property" ,
15
16
},
81
82
opacity = 1 ,
82
83
visible = True ,
83
84
id = 4 ,
85
+ parallax_factor = common_types .OrderedPair (2.3 , 1.2 ),
84
86
layers = [
85
87
layer .ObjectLayer (
86
88
name = "Object Layer 1" ,
115
117
opacity = 1 ,
116
118
visible = True ,
117
119
id = 5 ,
120
+ parallax_factor = common_types .OrderedPair (1.5 , 1.2 ),
118
121
image = Path ("../../images/tile_04.png" ),
119
122
),
120
123
]
Original file line number Diff line number Diff line change 10
10
"offsetx" :1 ,
11
11
"offsety" :3 ,
12
12
"opacity" :1 ,
13
+ "parallaxx" :1.4 ,
14
+ "parallaxy" :1.3 ,
13
15
"properties" :[
14
16
{
15
17
"name" :" test" ,
49
51
}],
50
52
"name" :" Group 1" ,
51
53
"opacity" :1 ,
54
+ "parallaxx" :2.3 ,
55
+ "parallaxy" :1.2 ,
52
56
"type" :" group" ,
53
57
"visible" :true ,
54
58
"x" :0 ,
70
74
"image" :" ..\/ ..\/ images\/ tile_04.png" ,
71
75
"name" :" Image Layer 2" ,
72
76
"opacity" :1 ,
77
+ "parallaxx" :1.5 ,
78
+ "parallaxy" :1.2 ,
73
79
"type" :" imagelayer" ,
74
80
"visible" :true ,
75
81
"x" :0 ,
79
85
"nextobjectid" :3 ,
80
86
"orientation" :" orthogonal" ,
81
87
"renderorder" :" right-down" ,
82
- "tiledversion" :" 1.4.1 " ,
88
+ "tiledversion" :" 1.5.0 " ,
83
89
"tileheight" :32 ,
84
90
"tilesets" :[
85
91
{
88
94
}],
89
95
"tilewidth" :32 ,
90
96
"type" :" map" ,
91
- "version" :1.4 ,
97
+ "version" :1.5 ,
92
98
"width" :8
93
99
}
You can’t perform that action at this time.
0 commit comments