pixi-dashed-line
pixi-dashed-line copied to clipboard
There seems to be no way to set the fill color
The fill color of the dashed lines or shape?
I'm very glad to see your answer. What I want to ask is how to fill the image surrounded by dotted lines, such as the color of triangles. Compare and make a dotted border of a triangle. I found that the effect of join = round is not perfect in the broken line display of triangles.
It's not a perfect implementation. What I usually do is draw the shape two times: first for the fill, and second with the dashed line.
Drawing separately is a good idea. Can I ask for advice? If the triangle needs to draw rounded corners, do you have any good suggestions?
There's a pixi library with another dashed line implementation that may support it. Regrettably, I searched and couldn't find it again. It's a general pixi.js extension that happens to support dashed lines. Hope you can find it!
Otherwise, you can use the PIXI.Graphics code to see how they implement curved lines, and then use similar implementation. The actual dashed line (non-texture) code is relatively simple. Adding the rounded join points should be only moderately difficult. Good luck!
Thanks for your advice and good luck