简体   繁体   中英

Is it possible to animate the path in fabric.js?

We can use paths in fabric.js in the following way:

let path = new fabric.Path('M 0 0 L 100 100 Z', {});

canvas.add(path);

Or we could animate them by some property like opacity:

path.animate('opacity', 1, {
    onChange: canvas.renderAll.bind(canvas)
});

Is there any way to animate the joining of each point of the path? In this case, is it possible to see the path going from (0, 0) to (100, 100). This is a silly example and I could easily achieve this result by using something other than paths but I wanted to know if I could do it this way to animate more complicated stuff with paths.

不,您不必自己制作动画并在一段时间内更新路径数据。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM