摘要:
代码如下: 1 var canvas = document.getElementById('my'), ctx = canvas.getContext('2d'); 2 setInterval(function(){ 3 ctx.clearRect(0,0,400,400); 4 ctx.save(); 5 ctx.translate(200,200); 6 var ci = 90, pi = Math.PI / ci, x1 = 100, y1 = 0, x2 = 0, y2 = 0, x3 = 0, y3 = 0; 9 ctx.beginPath();10 阅读全文
摘要:
实际代码如下:<html><head><title>html5 人物属性图</title></head><body><canvas id="my" width="400" height="400"></canvas><script language="javascript" type="text/javascript">var a = new $attr({ name : '路飞& 阅读全文
摘要:
实际代码如下:<html><head></head><body><canvas id="my_html5" width="400" height="400" style="border:1px solid black;"></canvas><script type="text/javascript">var ctx = document.getElementById('my_html5').get 阅读全文
摘要:
在内外圆的基础上加入了内部圆电流的效果,颜色也做了改变从原来的金黄渐变黑色改为紫色渐变黑色的效果,感觉好看一点代码如下:var canvas = document.getElementById('canvas'), ctx = canvas.getContext('2d'), r1 = 1, timer, r2 = 5, c_b = 1, g_r = 0, grad, ci = 90, pi = Math.PI / ci, sc = 1, r3 = 49, a1 = [], a2 = [], step = 5, w = 2, tran = 1;function 阅读全文