[Vuejs]-Konva vue js text slide into stage and then stop

1👍

You can just use node.to() method to animatio any Konva.Node:

mounted() {
    const textNode = this.$refs.text1.getNode();
    const endX = width / 2 - textNode.width() / 2;
    // run the animation
    textNode.to({
      x: endX,
      onFinish: () => {
        // update the state at the end
        this.textPos.x = endX;
      }
    })
  }

Demo: https://codesandbox.io/s/vue-konva-animation-demo-lr4qw

Leave a comment