13 lines
273 B
JavaScript
Raw Normal View History

const Texture2D = cc.Texture2D;
if (Texture2D) {
Object.assign(Texture2D.prototype, {
initWithElement (element) {
if (!element)
return;
this._image = element;
this.handleLoadedTexture();
},
});
}