时间:2021-07-01 10:21:17 帮助过:3人阅读
- <title> canvas 实例 </title><meta charset="utf-8"><canvas id="myCanvas" width="600" height="150">您的浏览器不支持canvas!</canvas><br><button onclick="Start();">Start</button><button onclick="Create();">Create</button>
- // 画圆,圆心是24,24,半径24,从角度0开始,画到2PI结束,最后一个参数是方向顺时针还是逆时针 cts.arc(x, y, radius, Math.PI * 2,0, true);
- // 画圆,圆心是24,24,半径24,从角度0开始,画到2PI结束,最后一个参数是方向顺时针还是逆时针 cts.arc(x, y, radius, Math.PI * 2,0, true);
这个可以逆时针,但我还是不知道怎么改我的代码
cts.arc(x, y, radius, Math.PI * 1.5, Math.PI * 1.5 - Math.PI * 2 * process / 100,true);
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="apple-touch-fullscreen" content="yes"> <meta name="format-detection" content="telephone=no"> <meta name="HandheldFriendly" content="true"> <meta http-equiv="x-rim-auto-match" content="none"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta property="og:type" content="website"> <meta property="og:image" content="75 pix image"> <meta property="og:site_name" content="South China Morning Post"> <meta property="og:description" content="Make every day matter"> <!--<meta property="fb:page_id" content="">--> <title></title> <base target="_blank"> <style type="text/css"> html {width: 100%; height: 100%;} body {width: 100%; height: 100%; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;} * {margin: 0; padding: 0;} .splash {position: absolute; z-index: 999; display: table; width: 100%; height: 100%; background-color: #f3f0eb;} .splash>.splash-inner {display: table-cell; text-align: center; vertical-align: middle;} .splash h1,.splash h2,.splash h3 {font-weight: normal;} .splash h3 {display: block; margin-top: 34px; font-size: 18px; color: #666; font-weight: lighter;} .splash .loading-circle {position: relative; width: 204px; height: 204px; margin: auto;} .splash .loading-circle>* {display: block; position: absolute; box-sizing: border-box; border-radius: 102px;} .splash .loading-circle>canvas.bg {z-index: 1; width: 100%; height: 100%; border: 8px solid #ddd ;} .splash .loading-circle>canvas.mask {z-index: 2; transform: rotate(-90deg); -webkit-transform: rotate(-90deg); -moz-transform: rotate(-90deg);} .splash .loading-circle>p {z-index: 3; width: 100%; height: 100%; text-align: center; line-height: 204px; font-size: 56px; font-weight: lighter; color: #999;} </style><div class="splash" id="splash"> <div class="splash-inner"> <h2></h2> <!--<h2>Make every day matter</h2>--> <div class="loading-circle" id="loadingCircle"> <p><span id="loadedNum">0</span>%</p> <canvas class="mask" id="loadingProgress" width="204" height="204"></canvas> <canvas class="bg" width="204" height="204"></canvas> </div> </div></div>
仅改成 false 是不行的,效果不对
要这样
- cts.arc(x, y, radius, Math.PI * 1.5, -3 * Math.PI * 1.5 + Math.PI * 2 * process / 100, false);