在使用 cc.Texture2D 的时候报错,示例代码如下。希望尽快修复
let texture=new cc.Texture2D();
let array=new Uint8Array(new ArrayBuffer(16))
texture.initWithData(array,cc.Texture2D.PixelFormat.RGBA8888,2,2);
在 update中377行报错,this._texture 是空
if (options.images && options.images.length > 0) {
this._texture.update(options);
}
是否将 this._texture.update(options); 应该改写成
if (!this._texture) {
this._texture = new renderer.Texture2D(renderer.device, opts);
}
else {
this._texture.update(opts);
}