Reputation: 1450
I'm trying to move a png or gif along a predetermined path inside a <canvas>
element. Can anyone provide a few resources or code samples to get me started?
Thanks in advance!
Upvotes: 2
Views: 9924
Reputation: 41858
You may want to look at this link: https://developer.mozilla.org/En/Canvas_tutorial:Basic_animations for more information, but basically your best bet is to erase the canvas, then redraw everything having moved the image, which you drew with 'drawImage'.
The x,y coordinates will change based on your path.
Upvotes: 2