diff --git a/bundles/pixi.js/src/useDeprecated.js b/bundles/pixi.js/src/useDeprecated.js index 4eaba3b..8a5077e 100644 --- a/bundles/pixi.js/src/useDeprecated.js +++ b/bundles/pixi.js/src/useDeprecated.js @@ -791,7 +791,17 @@ BlurYFilter, }); - const { Sprite, Texture } = PIXI; + const { Sprite, Texture, Graphics } = PIXI; + + // Support for pixi.js-legacy bifurcation + // give users a friendly assist to use legacy + if (!Graphics.prototype.generateCanvasTexture) + { + Graphics.prototype.generateCanvasTexture = function generateCanvasTexture() + { + deprecation(v5, 'PIXI.Graphics#generateCanvasTexture is only available in "pixi.js-legacy"'); + }; + } // Use these to deprecate all the Sprite from* methods function spriteFrom(name, source, crossorigin, scaleMode) diff --git a/bundles/pixi.js/src/useDeprecated.js b/bundles/pixi.js/src/useDeprecated.js index 4eaba3b..8a5077e 100644 --- a/bundles/pixi.js/src/useDeprecated.js +++ b/bundles/pixi.js/src/useDeprecated.js @@ -791,7 +791,17 @@ BlurYFilter, }); - const { Sprite, Texture } = PIXI; + const { Sprite, Texture, Graphics } = PIXI; + + // Support for pixi.js-legacy bifurcation + // give users a friendly assist to use legacy + if (!Graphics.prototype.generateCanvasTexture) + { + Graphics.prototype.generateCanvasTexture = function generateCanvasTexture() + { + deprecation(v5, 'PIXI.Graphics#generateCanvasTexture is only available in "pixi.js-legacy"'); + }; + } // Use these to deprecate all the Sprite from* methods function spriteFrom(name, source, crossorigin, scaleMode) diff --git a/packages/canvas/canvas-graphics/src/Graphics.js b/packages/canvas/canvas-graphics/src/Graphics.js index 621cb09..cd6e5ba 100644 --- a/packages/canvas/canvas-graphics/src/Graphics.js +++ b/packages/canvas/canvas-graphics/src/Graphics.js @@ -7,7 +7,8 @@ const tempMatrix = new Matrix(); /** - * Generates a canvas texture. + * Generates a canvas texture. Only available with **pixi.js-legacy** bundle + * or the **@pixi/canvas-graphics** package. * @method generateCanvasTexture * @memberof PIXI.Graphics# * @param {number} scaleMode - The scale mode of the texture.