cocos-enhance-kit/adapters/common/engine/Texture2D.js
2024-10-16 17:12:08 +08:00

13 lines
273 B
JavaScript

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