+ Pixmap.__init__(self)
+
+class MovingPixmap(Pixmap):
+ def __init__(self):
+ Pixmap.__init__(self)
+
+ self.moving = False
+
+ # TODO: get real values
+ self.x = 0.0
+ self.y = 0.0
+
+ self.clearPath()
+
+ self.moveTimer = eTimer()
+ self.moveTimer.timeout.get().append(self.doMove)
+
+ def clearPath(self, repeated = False):
+ if (self.moving):
+ self.moving = False
+ self.moveTimer.stop()
+
+ self.path = []
+ self.currDest = 0
+ self.repeated = repeated
+
+ def addMovePoint(self, x, y, time = 20):
+ self.path.append((x, y, time))
+
+ def moveTo(self, x, y, time = 20):
+ self.clearPath()
+ self.addMovePoint(x, y, time)
+
+ def startMoving(self):
+ if not self.moving:
+ self.time = self.path[self.currDest][2]
+ self.stepX = (self.path[self.currDest][0] - self.x) / float(self.time)
+ self.stepY = (self.path[self.currDest][1] - self.y) / float(self.time)