I want to use gradient color on textblock. As we already know, it is possible in normal html & css with the following code:
h1 {
font-size: 72px;
background: -webkit-linear-gradient(#eee, #333);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
Is there smth equivalent to achieve this?
I have some textblock’s in my project, where I use them dynamically for mathematical calculations (increasing them for some time etc), and using images of each number is so bad approach.
Thank you for your attention!
This is not supported at the moment and I do not think we have plans for it.
In your case I would probably rely on a dynamicTexture instead or a HtmlElementTexture and do everything in a canvas ?
what I am doing now is combining html and babylon gui, I’m creating some gradient div elements and appending them to the canvas element, is it best practice for my occasion? what do you think?
Not sure how you can do this one but yup the overall idea is to leverage what the canvas 2d has to offer, and if not possible you will need to create your own shapes/shaders.