Bezier Plugin Help:
i'd like to animate the drawing of a bezier line like one I'd see using graphics.bezierCurveTo... I dont want to use divs or SVGs. (and I'm using Pixijs v5 for rendering)
reading the docs says use BezierThrough method to draw the path using canvas graphics API... However there is no example for this.. and every example I've found online is just animating divs and SVG lines.
const bezier = new PIXI.Graphics();
bezier.lineStyle(4, 0xAA0000, 1);
bezier.position.x = 167;
bezier.position.y = 409;
let dest = {
x: 819,
y: 321
};
let localDest = {
x: dest.x - bezier.position.x,
y: dest.y - bezier.position.y
};
let cp1 = {
x: localDest.x * 0.25,
y: - 400
};
let cp2 = {
x: localDest.x * 0.75,
y: - 400
};
bezier.bezierCurveTo(cp1.x, cp1.y, cp2.x, cp2.y, localDest.x, localDest.y);
this.stage.addChild(bezier);
Thanks.