def cast(self, wand, start, end): print 33, wand self.animation = RayAnimation(self) self.item.reset(wand) start = QtCore.QPointF(*start) end = QtCore.QPointF(*end) self.setPos(start) self.animation.setup(end)
class RayWidget(QtGui.QGraphicsWidget): ray_klass = RayItem def __init__(self, parent, tile_width, direction): super(RayWidget, self).__init__(parent) self.animation = RayAnimation(self) self.item = self.ray_klass(self, tile_width, direction) def cast(self, wand, start, end): print 33, wand self.animation = RayAnimation(self) self.item.reset(wand) start = QtCore.QPointF(*start) end = QtCore.QPointF(*end) self.setPos(start) self.animation.setup(end)
def __init__(self, parent, tile_width, direction): super(RayWidget, self).__init__(parent) self.animation = RayAnimation(self) self.item = self.ray_klass(self, tile_width, direction)