Hi All, I'm trying to animate drawing on a Canvas ...
# tornadofx
i
Hi All, I'm trying to animate drawing on a Canvas using a Timeline, specifically via the onFinished EventHandler for each KeyFrame (i.e., no KeyValues are involved). I tried the following, but my animate(...) function is never being called. The app starts okay, and shows anything I do to the graphicsContext2D inside the canvas builder. Is there anything else I need to do to start the Timeline?
Copy code
override val root = group {
	canvas(800.0, 600.0) {
		timeline {
			keyframe(100.millis) {
				onFinished = EventHandler { animate(graphicsContext2D) }
			}
			cycleCount = Timeline.INDEFINITE
		}
	}
}