Changeset 523:9868bc79a6ff


Ignore:
Timestamp:
09/07/13 18:26:18 (8 years ago)
Author:
Simon Cross <hodgestar@…>
Branch:
default
Phase:
public
Rebase:
37373233323430346139316164663131663561613863383130376232386237343362653435333562
Message:

Move polys.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/area_editor.py

    r518 r523  
    872872        data = self.level.lookup[obj]
    873873        new_coords = self.level.point_to_pymunk(new_pos)
    874         data['args'][0][0] = new_coords[0]
    875         data['args'][0][1] = new_coords[1]
     874        args = data['args']
     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]
    876886        self.level.reset_objs()
    877887        self.invalidate()
Note: See TracChangeset for help on using the changeset viewer.