diff --git a/src/gameobjects/shape/FillStyleCanvas.js b/src/gameobjects/shape/FillStyleCanvas.js index 454cc9f0a..7a6bc18ca 100644 --- a/src/gameobjects/shape/FillStyleCanvas.js +++ b/src/gameobjects/shape/FillStyleCanvas.js @@ -13,11 +13,13 @@ * * @param {CanvasRenderingContext2D} ctx - The context to set the fill style on. * @param {Phaser.GameObjects.Shape} src - The Game Object to set the fill style from. + * @param {number} [altColor] - An alternative color to render with. + * @param {number} [altAlpha] - An alternative alpha to render with. */ -var FillStyleCanvas = function (ctx, src, altColor) +var FillStyleCanvas = function (ctx, src, altColor, altAlpha) { var fillColor = (altColor) ? altColor : src.fillColor; - var fillAlpha = src.fillAlpha; + var fillAlpha = (altAlpha) ? altAlpha : src.fillAlpha; var red = ((fillColor & 0xFF0000) >>> 16); var green = ((fillColor & 0xFF00) >>> 8); diff --git a/src/gameobjects/shape/LineStyleCanvas.js b/src/gameobjects/shape/LineStyleCanvas.js index 4d49faab9..b3ad5d093 100644 --- a/src/gameobjects/shape/LineStyleCanvas.js +++ b/src/gameobjects/shape/LineStyleCanvas.js @@ -13,11 +13,13 @@ * * @param {CanvasRenderingContext2D} ctx - The context to set the stroke style on. * @param {Phaser.GameObjects.Shape} src - The Game Object to set the stroke style from. + * @param {number} [altColor] - An alternative color to render with. + * @param {number} [altAlpha] - An alternative alpha to render with. */ -var LineStyleCanvas = function (ctx, src) +var LineStyleCanvas = function (ctx, src, altColor, altAlpha) { - var strokeColor = src.strokeColor; - var strokeAlpha = src.strokeAlpha; + var strokeColor = (altColor) ? altColor : src.strokeColor; + var strokeAlpha = (altAlpha) ? altAlpha : src.strokeAlpha; var red = ((strokeColor & 0xFF0000) >>> 16); var green = ((strokeColor & 0xFF00) >>> 8);