为了账号安全,请及时绑定邮箱和手机立即绑定

求求大家了我明天要交这个可是突然不能显示鱼了

求求大家了我明天要交这个可是突然不能显示鱼了

慕粉4249962 2017-07-26 00:53:39
var momObj = function(){ this.x ;//坐标 this.y ; this.bigEye = new Image();//鱼的眼睛 this.bigBody = new Image();//鱼的身体 this.bigTail = new Image();//鱼的尾巴}momObj.prototype.init = function(){ this.x = canWidth * 0.5; this.y = canHeight  * 0.5; this.bigEye.src = "./src/bigEye0.png"; this.bigBody.src = "./src/bigSwim0.png"; this.bigTail.src = "./src/bigTail0.png";}momObj.prototype.draw = function(){ ctx1.save(); ctx1.translate(this.x,this.y);/*方法转换画布的用户坐标系统。平移,将画布的坐标原点向左右方向移动x,向上下方向移动y.canvas的默认位置是在(0,0)*/ ctx1.drawImage(this.bigEye,-this.bigEye.width*0.5,-this.bigEye.height*0.5); ctx1.drawImage(this.bigBody,-this.bigBody.width*0.5,-this.bigBody.height*0.5); ctx1.drawImage(this.bigTail,-this.bigTail.width*0.5+30,-this.bigTail.height*0.5); ctx1.restore();}
查看完整描述

1 回答

已采纳
?
wDan_9527

TA贡献13条经验 获得超15个赞

draw ()方法只定义了,没执行

查看完整回答
反对 回复 2017-08-03
  • 1 回答
  • 0 关注
  • 1199 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信