HTML5 实现小车动画效果(Canvas/CSS3/JQuery)(6)

function drawTire(x,y){              w.save();              w.translate(x,y);              w.rotate(carAlpha);              w.strokeStyle='#3300FF';              w.lineWidth=1;              w.fillStyle='#0099FF';              w.beginPath();              w.arc(0,0,radius,0,2*Math.PI,false);              w.fill();              w.closePath();              w.beginPath();              w.moveTo(radius,0);              w.lineTo(-radius,0);              w.stroke();              w.closePath();              w.beginPath();              w.moveTo(0,radius);              w.lineTo(0,-radius);              w.stroke();              w.closePath();              w.restore();              }  

由于原理简单,并且代码中作了详细注释,这里就不一一讲解!

linux

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://127.0.0.1/wyydxj.html