Skip to content

Commit 2f57407

Browse files
committed
Setting the color value in the DynamicBitmapText.setDisplayCallback would inverse the red and blue channels if the color was not properly encoded for WebGL. It is now encoded automatically, meaning you can pass normal hex values as the colors in the display callback. Fix phaserjs#5225
1 parent d616ed7 commit 2f57407

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextWebGLRenderer.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
var Utils = require('../../../renderer/webgl/Utils');
8+
var GetColorFromValue = require('../../../display/color/GetColorFromValue');
89

910
/**
1011
* Renders this Game Object with the WebGL Renderer to the given Camera.
@@ -233,10 +234,10 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPerce
233234
tintBR = output.tint.bottomRight;
234235
}
235236

236-
tintTL = Utils.getTintAppendFloatAlpha(tintTL, camera.alpha * src._alphaTL);
237-
tintTR = Utils.getTintAppendFloatAlpha(tintTR, camera.alpha * src._alphaTR);
238-
tintBL = Utils.getTintAppendFloatAlpha(tintBL, camera.alpha * src._alphaBL);
239-
tintBR = Utils.getTintAppendFloatAlpha(tintBR, camera.alpha * src._alphaBR);
237+
tintTL = Utils.getTintAppendFloatAlpha(GetColorFromValue(tintTL), camera.alpha * src._alphaTL);
238+
tintTR = Utils.getTintAppendFloatAlpha(GetColorFromValue(tintTR), camera.alpha * src._alphaTR);
239+
tintBL = Utils.getTintAppendFloatAlpha(GetColorFromValue(tintBL), camera.alpha * src._alphaBL);
240+
tintBR = Utils.getTintAppendFloatAlpha(GetColorFromValue(tintBR), camera.alpha * src._alphaBR);
240241
}
241242

242243
x *= scale;

0 commit comments

Comments
 (0)