Page 1 of 1

gl.Text and reseting to white

Posted: 09 May 2009, 05:10
by zwzsg
In 7.8.2.1, the text color was reset to white at the beginning of every gl.Text.

In new Spring test build, it's not.

I have KP tooltip that use stuff such as:
txt = "\255\255\213\213Health: ".."\255\255\170\170"..ud.health
gl.Text(txt,x,y,FontSize,'o')
gl.Color(1,1,1,1) -- doesn't affect change to text color done within the string with escape character things

And then the red color gets carried over to the gl.Text of another widget (KP's buildbar's widget firewall/terminal timer.)

Since setting to white before a new line "\255\255\255\255\n" gets ignored, the only fix I found was to to do gl.Text("\255\255\255\255 ",0,0,FontSize,'o') at the end of my widget to leave gl.Text back to its default color.

Was it really intented behavior, or is it a bug? Either way, I'm sure many widget will leak their text colors to other widgets because of it.