You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For DynamicBitmapText.setDisplayCallback, when setting the characters color, the red and blue channels seem to be reversed.
It works fine when setting the DynamicBitmapText's tint color. Just not individual characters.
this.text=this.add.dynamicBitmapText(16,16,"font","This should be red.");this.text.setDisplayCallback((data)=>{data.color=0xff0000;returndata;});
Additional Information
I got it to work by swapping the r and b:
this.text=this.add.dynamicBitmapText(16,16,"font","This should be red.");this.text.setDisplayCallback((data)=>{data.color=0xff0000;varb=data.color&255;varg=(data.color>>8)&255;varr=(data.color>>16)&255;data.color=(1<<24)+(b<<16)+(g<<8)+r;returndata;});
The text was updated successfully, but these errors were encountered:
Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.
…k` 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. Fixphaserjs#5225
Version
Description
For DynamicBitmapText.setDisplayCallback, when setting the characters color, the red and blue channels seem to be reversed.
It works fine when setting the DynamicBitmapText's tint color. Just not individual characters.
I think the problem lines are 236-239 in: DynamicBitmapTextWebGLRenderer.js
Where it calls: Utils.getTintAppendFloatAlpha
Example Test Code
Additional Information
I got it to work by swapping the r and b:
The text was updated successfully, but these errors were encountered: