[LayaAir 2.0]parameter 2 is not of type 'WebGLTexture'
var htmlC:HTMLCanvas = btn_edit.drawToCanvas(btn_edit.width, btn_edit.height, 0, 0);
var interceptT:Texture = new Texture(htmlC);
var img:Sprite = new Sprite;
img.graphics.drawImage(interceptT, 0, 0, btn_edit.width, btn_edit.height);
Laya.stage.addChild(img);
如图和代码(一个按钮点击后draw图然后加入stage)
只要添加至stage后,随后就会出现这个错误,跟踪查到传入的不是WebGLTexture而是一个canvas,应该是渲染出问题
从2.0版本到2.0.2都有这个问题,具体项目见附件
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
yunzhongjushi
赞同来自: