Mercurial > nagslang
comparison tools/area_editor.py @ 523:9868bc79a6ff
Move polys.
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Sat, 07 Sep 2013 20:26:18 +0200 |
parents | 83f3a376e9a7 |
children | 011a087c4370 |
comparison
equal
deleted
inserted
replaced
522:846aacf92d59 | 523:9868bc79a6ff |
---|---|
869 edit_dlg.cleanup() | 869 edit_dlg.cleanup() |
870 | 870 |
871 def _update_pos(self, obj, new_pos): | 871 def _update_pos(self, obj, new_pos): |
872 data = self.level.lookup[obj] | 872 data = self.level.lookup[obj] |
873 new_coords = self.level.point_to_pymunk(new_pos) | 873 new_coords = self.level.point_to_pymunk(new_pos) |
874 data['args'][0][0] = new_coords[0] | 874 args = data['args'] |
875 data['args'][0][1] = new_coords[1] | 875 old_coords = list(args[0]) |
876 args[0][0] = new_coords[0] | |
877 args[0][1] = new_coords[1] | |
878 param_defs = obj.requires()[1:] # chop off name | |
879 for i, (_key, key_type) in enumerate(param_defs): | |
880 if i > len(args): | |
881 break | |
882 if key_type == "polygon (convex)": | |
883 args[i] = self.level.translate_poly( | |
884 args[i], old_coords, new_coords) | |
885 print args[i] | |
876 self.level.reset_objs() | 886 self.level.reset_objs() |
877 self.invalidate() | 887 self.invalidate() |
878 | 888 |
879 | 889 |
880 class HighLightButton(Button): | 890 class HighLightButton(Button): |