diff --git a/cocos2d/core/components/CCMask.js b/cocos2d/core/components/CCMask.js index f20ef0fba2..f401cd5a5c 100644 --- a/cocos2d/core/components/CCMask.js +++ b/cocos2d/core/components/CCMask.js @@ -257,7 +257,17 @@ let Mask = cc.Class({ onEnable () { this._super(); - if (this._type !== MaskType.IMAGE_STENCIL) { + if (this._type === MaskType.IMAGE_STENCIL) { + if (!this._spriteFrame || !this._spriteFrame.textureLoaded()) { + // Do not render when sprite frame is not ready + this.markForRender(false); + if (this._spriteFrame) { + this._spriteFrame.once('load', this._onTextureLoaded, this); + this._spriteFrame.ensureLoadTexture(); + } + } + } + else { this._updateGraphics(); }