第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定

我的為什么效果沒有星星呢==明明和老師的差不多,到底哪里出錯(cuò)鳥==

<!DOCTYPE?html>
<html>
<head>
????<meta?charset="UTF-8">
????<title>star</title>
????<style>
????canvas{
????????border:?solid?1px?black;?
????????display:?block;
????}
????</style>
</head>
<body>
????<canvas?id="canvas"?width="800"?height="800"></canvas>
????<!--?//?<script?src="../js/star.js"></script>?-->
????<script>
????
????window.onload=function(){
????????var?can=document.getElementById("canvas");
????????var?ctx=can.getContext("2d");
????????var?w=can.width;
????????var?h=can.height;

????????ctx.fillStyle="black";
????????ctx.fillRect(0,?0,?w,?h);
????????for(var?i=0;i<20;i++)
????????{

????????????var?r=Math.random()*10+10;
????????????var?x=Math.random()*w;
????????????var?y=Math.random()*h;
????????????var?a=Math.random()*360;

????????????drawStar(ctx,x,y,r,r/2.0,a);
????????}
????????//?drawStar(ctx,400,400,300,150,30);
????}
????function?drawStar(ctx,x,y,R,r,rot){
????????ctx.beginPath();
????????for(var?i=0;i<5;i++)
????????{
????????????ctx.lineTo(Math.cos((18+i*72-rot)/180*Math.PI)*R+x,
???????????????????????-Math.sin((18+i*72-rot)/180*Math.PI)*R+x);
????????????ctx.lineTo(Math.cos((54+i*72-rot)/180*Math.PI)*r+y,
???????????????????????-Math.sin((54+i*72-rot)/180*Math.PI)*r+y);
????????}
????????ctx.closePath();
????????ctx.lineWidth=10;
????????ctx.fillStyle="#fb3";
????????ctx.strokeStyle="#fb5";

????????ctx.fill();
????????ctx.stroke();
????????

????}

????</script>
</body>
</html>


正在回答

2 回答

x y那有問題

1 回復(fù) 有任何疑惑可以回復(fù)我~
#1

qq_胖漏漏_0 提問者

知道了,蟹蟹~
2016-06-12 回復(fù) 有任何疑惑可以回復(fù)我~
#2

qq_胖漏漏_0 提問者

蟹蟹~
2016-06-14 回復(fù) 有任何疑惑可以回復(fù)我~


?ctx.lineTo(Math.cos((18+i*72-rot)/180*Math.PI)*R+x,
???????????????????????-Math.sin((18+i*72-rot)/180*Math.PI)*R+x);
????????????ctx.lineTo(Math.cos((54+i*72-rot)/180*Math.PI)*r+y,
???????????????????????-Math.sin((54+i*72-rot)/180*Math.PI)*r+y);

這里的x y? 位置不對哦

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

我的為什么效果沒有星星呢==明明和老師的差不多,到底哪里出錯(cuò)鳥==

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號