Page 1 of 1

PostPosted: Fri Mar 02, 2001 10:03 pm
by IndiQa
Greets all,

I have a real simple question but I sure can't figure it out.

I print a string to the screen. Background mode is transparent so you don't get the text box background clashing with the rest of the screen background. However when I update the text the new string overwrites the old one without removing the old one. So I end up with an unreadable blob at the text position. Works fine if I set the background to opaque but then it looks ugly with the different text background color.

How do I either set the text background to match the rest of the screen background in the opaque mode. Or clear the text and then write the new text to the same position in the transparent mode?



PostPosted: Sat Mar 03, 2001 8:14 am
by ianf
Hi Curt
Assuming you want to draw your own text ( ie: you don't want a windows text box cause you can't change it's font, size etc ) you need to clear away the previous text using a rectangle with the same pen color as the background. That's what I do & it works fine. I also use the text width function to work out how wide my next string is for positioning. Here's some of my code which is specific to my application but gives you a good lead. variable 'mes' is a string with the text in it already:-
setfontattr("Final Frontier",0,0,0,400,13,18);

Hope this helps

PostPosted: Sat Mar 03, 2001 2:27 pm
by IndiQa
Thank you Ian that works perfectly.