Mercurial > fife-parpg
comparison engine/extensions/serializers/xmlobject.py @ 152:679ed3e15513
Deprecation: getIndex is now thrown out.
Import fife_compat for the transition.
author | phoku@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Sat, 11 Oct 2008 12:55:41 +0000 |
parents | 3fddb45c0304 |
children | 376b8afc9a18 |
comparison
equal
deleted
inserted
replaced
151:afcd83f7fac8 | 152:679ed3e15513 |
---|---|
97 # paths are relative to this resource's path | 97 # paths are relative to this resource's path |
98 path = self.filename.split('/') | 98 path = self.filename.split('/') |
99 path.pop() | 99 path.pop() |
100 path.append(str(source)) | 100 path.append(str(source)) |
101 | 101 |
102 id = self.image_pool.getIndex('/'.join(path)) | 102 id = self.image_pool.addResourceFromFile('/'.join(path)) |
103 object.get2dGfxVisual().addStaticImage(int( image.get('direction', 0) ), id) | 103 object.get2dGfxVisual().addStaticImage(int( image.get('direction', 0) ), id) |
104 img = self.image_pool.getImage(id) | 104 img = self.image_pool.getImage(id) |
105 img.setXShift(int( image.get('x_offset', 0) )) | 105 img.setXShift(int( image.get('x_offset', 0) )) |
106 img.setYShift(int( image.get('y_offset', 0) )) | 106 img.setYShift(int( image.get('y_offset', 0) )) |
107 | 107 |
124 # animation paths are relative to this resource's path | 124 # animation paths are relative to this resource's path |
125 path = self.filename.split('/') | 125 path = self.filename.split('/') |
126 path.pop() | 126 path.pop() |
127 path.append(str(source)) | 127 path.append(str(source)) |
128 | 128 |
129 anim_id = self.anim_pool.getIndex('/'.join(path)) | 129 anim_id = self.anim_pool.addResourceFromFile('/'.join(path)) |
130 animation = self.anim_pool.getAnimation(anim_id) | 130 animation = self.anim_pool.getAnimation(anim_id) |
131 action.get2dGfxVisual().addAnimation(int( anim.get('direction', 0) ), anim_id) | 131 action.get2dGfxVisual().addAnimation(int( anim.get('direction', 0) ), anim_id) |
132 action.setDuration(animation.getDuration()) | 132 action.setDuration(animation.getDuration()) |