开发者

HTML5 Move Image Along Path

开发者 https://www.devze.com 2023-03-03 21:14 出处:网络
I\'m trying to move a png or gif along a predetermin开发者_StackOverflowed path inside a <canvas> element. Can anyone provide a few resources or code samples to get me started?

I'm trying to move a png or gif along a predetermin开发者_StackOverflowed path inside a <canvas> element. Can anyone provide a few resources or code samples to get me started?

Thanks in advance!


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消