-
document.body.clientWidth ==> BODY对象宽度 document.body.clientHeight ==> BODY对象高度 document.documentElement.clientWidth ==> 可见区域宽度 document.documentElement.clientHeight ==> 可见区域高度查看全部
-
当我们的路径不封闭时,closePath()会把路径封闭。beginPath()表示要重新规划一个路径,它和closePath()不一定要成对出现 context.arc(centerX,centerY,radius,startAngle,endAngle,anticlockwise) 调用fill()时,canvas会自动将未封闭的路径封闭查看全部
-
function update(){ //下落 ball.x += ball.vx;//x = vx*t ball.y += ball.vy;//y = vy*t ball.vy += ball.g;//vy = g*t //下边碰撞 if(ball.y >= 768 -ball.r){ ball.y = 768 -ball.r ball.vy = -ball.vy*0.9 } //右边碰撞 if(ball.x >= 1024 -ball.r){ ball.x = 1024 -ball.r ball.vx = -ball.vx*0.9 } //左边碰撞 if(ball.x <= ball.r){ ball.x = ball.r ball.vx = -ball.vx*0.9 } }查看全部
-
if( nextSeconds != curSeconds ){ curShowTimeSeconds = nextShowTimeSeconds; } 如果没有这段,动画要每秒刷新20次,这段代码可以提高性能查看全部
-
canvas不适合用css操作大小查看全部
-
ctx.lineWidth - 定义线条宽度 ctx.strokeStyle - 定义线条样式 ctx.fillStyle - 定义填充样式 ctx.stroke() - 绘制线条 ctx.fill() - 填充查看全部
-
date的简单设置: var endTime = new Date("2016/3/2, 23:43:21"); 在设置endTime时,不能超过当前时间99小时59分59秒,因为计时器最大计数为此查看全部
-
刚刚看了介绍,感觉很棒!好好奇!查看全部
-
<meta content="yes" name="apple-mobile-web-app-capable" />iphone设备中的safari私有meta标签,它表示:允许全屏模式浏览;查看全部
-
<meta content="black" name="apple-mobile-web-app-status-bar-style" />第三个meta标签也是iphone的私有标签,它指定的iphone中safari顶端的状态条的样式;查看全部
-
<meta content="telephone=no" name="format-detection" /> 告诉设备忽略将页面中的数字识别为电话号码查看全部
-
很激动查看全部
-
1, 弧形路劲绘制 context.beginPath(); context.arc( centerX,centerY,radius, //圆心坐标和半径 startingAngle,endingAngle, //起始弧度值结束弧度值 anticlockwise = false //绘制方向, false顺时针,true逆时针 ); //这个同样只是路劲的绘制 context.stroke(); // 线圆弧 这里的绘制没有context.closePath();表示绘制弧形首尾不用线段连接 context.fillStyle = "#005588"; //设置填充颜色 context.fill(); //根据路劲和设置的颜色进行填充,填充的话会自动把路劲首位相连然后填充查看全部
-
1.canvas常用的三个属性和方法: canvas.width=1024; canvas.height=768; canvas.getContext("2d"); 2.canvas绘图是状态绘制,即先设置好状态,再执行绘制,如: var context=canvas.getContext("2d"); context.moveTo(100,100); //相当于将笔尖移到该位置 context.lineTo(700,700); //相当于笔尖要从起始位置移动到的位置 context.stroke(); //执行绘制查看全部
-
http://www.w3school.com.cn/tags/canvas_arc.asp查看全部
举报
0/150
提交
取消