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

lines in one graphic event #5465

Closed
xiaoshidetaikuai opened this issue Feb 21, 2019 · 5 comments
Closed

lines in one graphic event #5465

xiaoshidetaikuai opened this issue Feb 21, 2019 · 5 comments

Comments

@xiaoshidetaikuai
Copy link

xiaoshidetaikuai commented Feb 21, 2019

like this fiddle https://jsfiddle.net/Fboy/pf6cx592/2/
I use one graphic to draw more lines,I want add event for every lines.How do I change it?

@ivanpopelyshev
Copy link
Collaborator

I cant interpret what do you want. Please provide more information.

@xiaoshidetaikuai
Copy link
Author

xiaoshidetaikuai commented Feb 22, 2019

I want to add events to each line. When the mouse hover line, change the color or thickness of the line, etc.

@ivanpopelyshev
Copy link
Collaborator

ivanpopelyshev commented Feb 22, 2019

Sorry, pixi does not have that feature.

easy way: each line is its own graphics. Its slow.
hard way: use Mesh instead, override containsPoint that way it modifies the mesh. Add colors in shader
hard way number 2: take Graphics element, copy all the code, or just override parts that matter: containsPoint, lines rebuild algorithm. Its possible, but its very hard way.

@xiaoshidetaikuai
Copy link
Author

I have tried the simple method, it is really slow, I will try the second method. thanks a lot

@lock
Copy link

lock bot commented Feb 22, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Feb 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants