Skip to content

Commit

Permalink
Merge 2b93f8b into 83759a8
Browse files Browse the repository at this point in the history
  • Loading branch information
encukou committed Nov 12, 2014
2 parents 83759a8 + 2b93f8b commit 5c1e21a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions tmxlib/fileio.py
Expand Up @@ -189,6 +189,9 @@ def map_from_element(self, cls, root, base_path):
base_path=base_path,
background_color=background_color,
)
render_order = root.attrib.pop('renderorder', None)
if render_order:
args['render_order'] = render_order
assert not root.attrib, 'Unexpected map attributes: %s' % root.attrib
map = cls(**args)
for elem in root:
Expand Down Expand Up @@ -224,6 +227,8 @@ def map_to_element(self, map, base_path):
if map.background_color:
elem.attrib['backgroundcolor'] = '#{0}'.format(
to_hexcolor(map.background_color))
if map.render_order:
elem.attrib['renderorder'] = map.render_order
self.append_properties(elem, map.properties)
for tileset in map.tilesets:
elem.append(self.tileset_to_element(tileset,
Expand Down
4 changes: 3 additions & 1 deletion tmxlib/map.py
Expand Up @@ -76,7 +76,8 @@ class Map(fileio.ReadWriteBase, helpers.SizeMixin):
# correctly as they can.
# And it's not just here...
def __init__(self, size, tile_size, orientation='orthogonal',
background_color=None, base_path=None):
background_color=None, base_path=None,
render_order=None):
self.orientation = orientation
self.size = size
self.tile_size = tile_size
Expand All @@ -85,6 +86,7 @@ def __init__(self, size, tile_size, orientation='orthogonal',
self.background_color = background_color
self.properties = {}
self.base_path = base_path
self.render_order = render_order

@property
def pixel_size(self):
Expand Down
2 changes: 1 addition & 1 deletion tmxlib_test/tiled
Submodule tiled updated from 85ec39 to 915fd3

0 comments on commit 5c1e21a

Please sign in to comment.