setMask(mask, rect) {
    if (_.isString(mask)) {
      const texture = cc.textureCache.getTextureForKey(mask);
      if (texture != null) {
        mask = texture;
      }
    }
    if (this.mask != mask) {
      this.mask = mask;

      // auto manage mask component
      this.autoManageComponentById(this.getIsMasked(), 'Mask', this.createMaskComponent.bind(this));
    }

    this.setMaskRect(rect);
  }
Sets the masking texture.
@param {String|Texture|null} mask
@param {cc.Rect} rect rectangle to size mask relative to sprite size