How does one continuous loop an animation using animate
? In this example, all I want to do is endlessly rotate a white square.
myBall = new Layer
x: 100
y: 100
width: 200
height: 200
borderRadius: "20px"
backgroundColor: "#FFF"
myBall.animate
properties:
rotationZ: 360
time: 1
myBall.on Events.AnimationEnd, ->
this.animate
properties:
rotationZ: 360
time: 1
this.backgroundColor = "#666"
After the first 360˚ z rotation, the background color will be changed to #666, but the animations will cease. I think it would be ideal if repeat: -1
indicated continuous without having to listen for AnimationEnd
.