Length of pen stroke

Is there a way to find the length of the pen stroke?

Not built in. You could calculate the dist() between mouse positions and tally them as you draw - probably put it in an interval() or maybe it would work in the Pen drawing event. Try it out, if you need a hand, let us know. @pettis - this would be a good ZIM Challenge.

Thanks. That's what I did. I used the pen.x, pen.y on pen.start and pen.stop and calculated distance. Perfect! I am using that to rotate a wheel of fortune type game. Worked like a charm, quick and easy way to spin and stop it.

I added a blob with as many points as wheel slices and now I need to calculate when the stopping point. I added a hittest on the blob children and the "pin", via a loop. It works but I am getting the last three hit point, even after I added an timeout interval. I left it for a while to clear my brain.

Basically, I need to know which blob point the wheel stops on so I can take appropriate action.

Any ideas?

1 Like

waauw .. can you share your code to help..