GML [El Solvedo] Any way to change the colour of the sprite font?

E

Edwin

Guest
Hello.

I have a sprite font.
Code:
global.spritefont_black = font_add_sprite( ... );
I need to change the colour of that, but it's a sprite so there is no way to change it instead of creating new sprite for your coloured font.

What should I do? Transform my sprite font into default font? If so, what programs will help with that?
 
E

Edwin

Guest
You'll also want your pixel fonts in pure white so the coloring works as you're intending.
Oops, sorry for dumb question. You're right. I knew that white is some kind of iconic for text, but I didn't think of it :oops:
 

NightFrost

Member
Yes. This is because the colorization used by the commands runs in the same manner as you can see in a default fragment shader. It multiplies a pixel's color with the provided color. Since all RGB values will be handled in 0 to 1 range, it will multiply the font sprite's white (1.0, 1.0, 1.0) by whatever color you provided, and the result is exactly the color you wanted.
 
Top