mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2025-04-20 19:08:40 +00:00
13 lines
273 B
JavaScript
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();
|
||
|
},
|
||
|
});
|
||
|
}
|