def makeAnims(): avg.ParallelAnim([ avg.LinearAnim(self.__node, "x", 200, 0, 60), avg.LinearAnim(self.__node, "y", 200, 0, 120) ]).start() avg.LinearAnim(self.__node, "x", 300, 0, 100, False, None).start()
def startTimedAnim(): self.anim = avg.ParallelAnim([ avg.LinearAnim(self.nodes[0], "x", 200, 0, 60), avg.LinearAnim(self.nodes[1], "x", 400, 0, 120), ], None, animStopped, 200) self.__endCalled = False self.anim.start()
def startAnim(): self.anim = avg.ParallelAnim([ avg.LinearAnim(self.nodes[0], "x", 200, 0, 60), avg.LinearAnim(self.nodes[1], "x", 400, 0, 120), avg.EaseInOutAnim(self.nodes[2], "x", 400, 0, 120, 100, 100) ], None, animStopped) self.__endCalled = False self.anim.start()
def show(self): s = self.getMediaSize() assert s.x and s.y # initial size and position (scaled to screen size and centered) self.size = scaleMax(s, self.parent.size) self.pos = (self.parent.size - self.size) * 0.5 # random final size and position (center moved by (dx, dy) and scaled up accordingly) dx = float(randint(-ANIM_MAX_MOVE, ANIM_MAX_MOVE)) dy = float(randint(-ANIM_MAX_MOVE, ANIM_MAX_MOVE)) size = scaleMin(s, self.size + avg.Point2D(abs(dx), abs(dy)) * 2.0) pos = self.pos + avg.Point2D(dx, dy) + (self.size - size) * 0.5 # start in-transition avg.Anim.fadeIn(self, TRANS_INTERVAL) # start move/scale animation avg.ParallelAnim([ avg.LinearAnim(self, 'size', ANIM_INTERVAL, self.size, size), avg.LinearAnim(self, 'pos', ANIM_INTERVAL, self.pos, pos)]).start()
def startFireForgetAnim(): avg.ParallelAnim([ avg.LinearAnim(self.nodes[0], "x", 200, 0, 60), avg.LinearAnim(self.nodes[1], "x", 200, 0, 120) ]).start()