亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

大魚在 canvas1 上沒有顯示

場景設置:

#canvas1{

position:absolute;

bottom:0;

left:0;

z-index:1;

}

#canvas2{

position:absolute;

bottom:0;

left:0;

z-index:0;

}

畫布獲取:

can1=document.getElementById("canvas1");

ctx1=can1.getContext('2d');/* 繪制 2d 場景 */

大魚設置:

this.x =canWidth * 0.5;

this.y =canHeight * 0.5;

ctx1.drawImage(this.bigEye, -this.bigEye * 0.5, -this.bigEye * 0.5);

ctx1.drawImage(this.bigBody, -this.bigBody * 0.5, -this.bigBody * 0.5);

ctx1.drawImage(this.bigTail, -this.bigTail * 0.5 + 30, -this.bigTail * 0.5);


正在回答

3 回答

可是為什么老師寫的ctx1.drawImage()大魚是能夠出來的呢。

0 回復 有任何疑惑可以回復我~

ctx1.drawImage(this.bigEye, -this.bigEye * 0.5, -this.bigEye * 0.5); ?

寫錯了,應該是?

ctx2.drawImage(this.bigEye, -this.bigEye.width * 0.5, -this.bigEye.height * 0.5);

1 回復 有任何疑惑可以回復我~

draw()函數要在mian.js中調用

0 回復 有任何疑惑可以回復我~
#1

1307111376 提問者

function gameloop() 中調取了
2016-02-19 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

大魚在 canvas1 上沒有顯示

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號