Basic animation

This commit is contained in:
Greg Shuflin 2023-10-03 02:55:34 -07:00
parent b2d2102779
commit 7431483bd0

View File

@ -36,4 +36,14 @@ layer.add(circle);
stage.add(layer);
layer.draw();
const pointerAnim = new Konva.Animation((frame) => {
//const pos = stage.getPointerPosition();
const centerX = stage.width() / 2;
circle.x(50*Math.sin((frame.time * 2 * Math.PI) / 2000) + centerX);
}, layer);
pointerAnim.start();
console.log("Ended");