DrawText with Transparent Background

Hi All, it’s been awhile (last post at HTMLDevs).
I want text with transparent background in my next BIG project (to be posted real-soon-now).
My method: playground

  • Works in Chrome.
  • Works in Firefox.
  • Fails in Microsoft Edge.

Can you offer correction or work-a-round?

Thanks!

Hi.

Maybe this can help you

Oh sorry, didn’t see it properly. It’s not the same thing. Probably will not help you :slight_smile:

Hi @Coolroar perhaps something along these lines may help https://www.babylonjs-playground.com/#TMHF80#10

1 Like

Interesting, seems as though Edge cannot handle 8-digit hex codes for canvas fillStyle.

https://www.w3schools.com/code/tryit.asp?filename=G7SNGTGJ947M

Seems to default to whatever the last valid fillStyle was.

1 Like

Hey! Thanks for quick replies :sunglasses:.

Devin_Write: yes, interesting – spot-on demo.

JohnK: that’s it! "transparent" in drawText bg param instead of "#0000" fixes it.

:+1::star::star::+1: