diff --git a/src/core/text/Text.js b/src/core/text/Text.js index 90649a7..3aa3182 100644 --- a/src/core/text/Text.js +++ b/src/core/text/Text.js @@ -32,10 +32,11 @@ /** * @param {string} text - The string that you would like the text to display * @param {object|PIXI.TextStyle} [style] - The style parameters + * @param {HTMLCanvasElement} [canvas] - The canvas element for drawing text */ - constructor(text, style) + constructor(text, style, canvas) { - const canvas = document.createElement('canvas'); + canvas = canvas || document.createElement('canvas'); canvas.width = 3; canvas.height = 3;