Mercurial > fife-parpg
changeset 601:6856cdb22351
fixed the write_instances function so that it saves the stack position variable of the instance visual when saving the map.
author | vtchill@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Sun, 05 Sep 2010 00:41:26 +0000 |
parents | 427150724fe1 |
children | 2032ec27b851 |
files | engine/python/fife/extensions/savers.py |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/engine/python/fife/extensions/savers.py Fri Aug 27 16:59:54 2010 +0000 +++ b/engine/python/fife/extensions/savers.py Sun Sep 05 00:41:26 2010 +0000 @@ -182,6 +182,7 @@ for inst in layer.getInstances(): position = inst.getLocationRef().getExactLayerCoordinates() + attr_vals = { (None, 'o'): inst.getObject().getId(), (None, 'x'): str(position.x), @@ -197,6 +198,11 @@ (None, 'r'): 'r', } + visual = inst.get2dGfxVisual(); + if visual: + attr_vals[(None, 'stackpos')] = str(visual.getStackPosition()) + attr_names[(None, 'stackpos')] = 'stackpos' + nspace = inst.getObject().getNamespace() if nspace != self.nspace: attr_vals[(None, 'ns')] = inst.getObject().getNamespace()