hello, what is the easiest way to make a picturebox follow a path determined by waypoints? without using like 100 if statements and timers. Thanks
Printable View
hello, what is the easiest way to make a picturebox follow a path determined by waypoints? without using like 100 if statements and timers. Thanks
I'd really recommend WPF if you're going to be doing animations like this.
Get a copy of Expression Blend (60 day free trial).
Animating objects
How do you store your waypoints? using an array? Using a loop or a Timer make the pBox travel the Array by setting Left to X and Top to Y. Or can use a GraphicsPath, but i'm not sure there will be any difference in this case.
i just use labels as waypoints, I don't know if I can make that work
Could you attach your project?
Its attached, but a really simple version of it, due upload limit
Ok, this requires some aritmethic calculations for Distance, X and Y. As it is now the Waypoints are taken from Label's names, you can change Text on them but I used their names to define relations using the Controls Collection.
Note: You forgot to attach some images so I used another image for the PictureBox. The Project is attached.