Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIXI.Graphics - bezierCurveTo or lineTo not clickable #62

Open
titusimaginea opened this issue Jun 1, 2021 · 0 comments
Open

PIXI.Graphics - bezierCurveTo or lineTo not clickable #62

titusimaginea opened this issue Jun 1, 2021 · 0 comments

Comments

@titusimaginea
Copy link

Hello, After adding a line or curve using bezierCurveTo or lineTo function of PIXI.Graphics mouse events not triggering on them.

const arc = new PIXI.Graphics();
arc.lineStyle(lineWeight, 0x3388ff);

arc.moveTo(from.x, from.y);
arc.bezierCurveTo(mid.x, mid.y, mid.x, mid.y, to.x, to.y)

arc.interactive = true;

arc.on('click', () => {
    console.log("clicked")
});

arc.buttonMode = true

I tried the following

arc.hitArea = new PIXI.Polygon(arc.currentPath.points);

But its not only making the line clickable but also the fill area, which make sense since the hitArea is a Polygon.


I like to draw a curve and enable click on it (only on the line). I tried the docs and google not able to find any solution. Any help and tips are appreciated.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant