-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gradient on TextField #1067
Comments
Hmm ... Starling uses the Flash API to draw TrueType text, so to make this possible, one would first need to figure out how this can be done with Flash. The Graphics class unfortunately doesn't support drawing of text – that would be the natural place to look for the options for line thickness, gradients, etc. So you'd have to use the TextField and draw that to a BitmapData object (what Starling does internally), but this doesn't support color gradients. Well ... you might be able to get to the gradient via masking (in Flash, not Starling), and then apply the drop shadow and outline as filters. But in the end, you'd always have to upload that to the GPU. So, I think the short answer is probably "no". 😉 |
Well I can apply shadows, outline and other stuff. But stuck with gradients. |
I wrote that mesh gradient fill routine. Unfortunately there’s no straightforward way to use it with text, My code works with a Mesh object, and text in Starling does not use Meshes in a way that is useful (it draws a line of text as a Quad, which is a Mesh, but applying a gradient fill to that will just give you a shaded rectangle). If I had to do this I would probably do it in the classic Flash API. As Daniel notes the |
Thanks. I'll try to do that way and post results soon |
Another way recommended by openfl communuty |
I don’t know how that is implemented in OpenFL, but in Starling a mask has only one bit per pixel – it is either on or off. So you get jagged edges which tends to look horrible with text. |
Is it possible to create something like this without using bitmap fonts?
https://bit.ly/3bvEo8u
The text was updated successfully, but these errors were encountered: