I am having some success and enjoying using Animation on layers, however i am stuck on how to use Animation completion or Animation.finished
It would really help me if someone could add an example of the usage of both on the code below (example from the docs)
from scene import *
import sys
class MyScene (Scene):
def setup(self):
self.layer = Layer(Rect(self.size.w * 0.5 - 100,
self.size.h * 0.5 - 100, 200, 200))
self.layer.background = Color(1, 0, 0)
self.layer.animate('alpha', 0.0, duration=1.0,
autoreverse=True, repeat=sys.maxint)
def draw(self):
background(0, 0, 0)
self.layer.update(self.dt)
self.layer.draw()
run(MyScene())
From the docs:
Animation.completion
A function (without parameters) that gets called when the animation completes.
Animation.finished
Gets set to True when the animation finishes.
Thanks for your help !