mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2024-12-26 11:48:29 +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();
|
|
},
|
|
});
|
|
}
|