[]官方提供的关系链代码执行报错,是不是wx的sharedCanvas不是Laya的canvas导致的问题

https://ask.layabox.com/question/12349 这是官方提供的代码

微信主域代码:
Laya.timer.once(400,this,function():void{
var rankTexture:Texture = new Texture(Browser.window.sharedCanvas);
rankTexture.bitmap.alwaysChange = true;//小游戏使用,非常费,每帧刷新
rankSprite2.graphics.drawTexture(rankTexture,5,78,rankTexture.width,rankTexture.height);
});

报错bitmap._addReference is not a function
TypeError: bitmap._addReference is not a function


这是报错地方的代码
/**
*<code>Texture</code> 是一个纹理处理类。
*/
//class laya.resource.Texture extends laya.events.EventDispatcher
var Texture=(function(_super){
function Texture(bitmap,uv){
/**图片或者canvas 。*/
//this.bitmap=null;
/**UV信息。*/
//this.uv=null;
/**沿 X 轴偏移量。*/
this.offsetX=0;
/**沿 Y 轴偏移量。*/
this.offsetY=0;
/**原始宽度(包括被裁剪的透明区域)。*/
this.sourceWidth=0;
/**原始高度(包括被裁剪的透明区域)。*/
this.sourceHeight=0;
/**@private */
//this._loaded=false;
/**@private */
this._w=0;
/**@private */
this._h=0;
/**@private 唯一ID*/
//this.$_GID=NaN;
/**图片地址*/
//this.url=null;
/**@private */
this._uvID=0;
this._atlasID=-1;
/**@private */
this.scaleRate=1;
Texture.__super.call(this);
if (bitmap){
bitmap._addReference();
}
this.setTo(bitmap,uv);
}
已邀请:

Prajna

赞同来自:

自己解决了

zhaodi0217

赞同来自:

你好,想请教一下,能否在开放域请求自己的接口?
 

Thylx

赞同来自:

你好,按照你博客里面的来出现 Browser is not defined,请问下这个要怎么解决呢?

挨踢大侠

赞同来自:

1年多过去了, 这个bug还在

要回复问题请先

商务合作
商务合作