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:
5656 visible : bool
5757
5858 coordinates : OrderedPair = OrderedPair (0 , 0 )
59+ parallax_factor : OrderedPair = OrderedPair (1 , 1 )
5960
6061 id : Optional [int ] = None
6162 size : Optional [Size ] = None
@@ -195,6 +196,8 @@ class RawLayer(TypedDict):
195196 objects : List [tiled_object .RawTiledObject ]
196197 offsetx : float
197198 offsety : float
199+ parallaxx : float
200+ parallaxy : float
198201 opacity : float
199202 properties : List [properties_ .RawProperty ]
200203 startx : int
@@ -350,6 +353,11 @@ def _get_common_attributes(raw_layer: RawLayer) -> Layer:
350353 if raw_layer .get ("properties" ) is not None :
351354 common_attributes .properties = properties_ .cast (raw_layer ["properties" ])
352355
356+ if raw_layer .get ("parallaxx" ) is not None :
357+ common_attributes .parallax_factor = OrderedPair (
358+ raw_layer ["parallaxx" ], raw_layer ["parallaxy" ]
359+ )
360+
353361 return common_attributes
354362
355363
Original file line number Diff line number Diff line change 1010 id = 1 ,
1111 size = common_types .Size (8 , 6 ),
1212 offset = common_types .OrderedPair (1 , 3 ),
13+ parallax_factor = common_types .OrderedPair (1.4 , 1.3 ),
1314 properties = {
1415 "test" : "test property" ,
1516 },
8182 opacity = 1 ,
8283 visible = True ,
8384 id = 4 ,
85+ parallax_factor = common_types .OrderedPair (2.3 , 1.2 ),
8486 layers = [
8587 layer .ObjectLayer (
8688 name = "Object Layer 1" ,
115117 opacity = 1 ,
116118 visible = True ,
117119 id = 5 ,
120+ parallax_factor = common_types .OrderedPair (1.5 , 1.2 ),
118121 image = Path ("../../images/tile_04.png" ),
119122 ),
120123]
Original file line number Diff line number Diff line change 1010 "offsetx" :1 ,
1111 "offsety" :3 ,
1212 "opacity" :1 ,
13+ "parallaxx" :1.4 ,
14+ "parallaxy" :1.3 ,
1315 "properties" :[
1416 {
1517 "name" :" test" ,
4951 }],
5052 "name" :" Group 1" ,
5153 "opacity" :1 ,
54+ "parallaxx" :2.3 ,
55+ "parallaxy" :1.2 ,
5256 "type" :" group" ,
5357 "visible" :true ,
5458 "x" :0 ,
7074 "image" :" ..\/ ..\/ images\/ tile_04.png" ,
7175 "name" :" Image Layer 2" ,
7276 "opacity" :1 ,
77+ "parallaxx" :1.5 ,
78+ "parallaxy" :1.2 ,
7379 "type" :" imagelayer" ,
7480 "visible" :true ,
7581 "x" :0 ,
7985 "nextobjectid" :3 ,
8086 "orientation" :" orthogonal" ,
8187 "renderorder" :" right-down" ,
82- "tiledversion" :" 1.4.1 " ,
88+ "tiledversion" :" 1.5.0 " ,
8389 "tileheight" :32 ,
8490 "tilesets" :[
8591 {
8894 }],
8995 "tilewidth" :32 ,
9096 "type" :" map" ,
91- "version" :1.4 ,
97+ "version" :1.5 ,
9298 "width" :8
9399}
You can’t perform that action at this time.
0 commit comments