|
how to change text color?
#221450
08/14/08 03:30
08/14/08 03:30
|
Joined: Jun 2008
Posts: 40
pfeldman
OP
Newbie
|
OP
Newbie
Joined: Jun 2008
Posts: 40
|
I have a PANEL that looks like this:
PANEL* panDisplay= { digits(100, 300, "# 1: %0.1f", "Arial#60b", 1, t_1); digits(450, 300, "# 2: %0.1f", "Arial#60b", 1, t_2); flags= VISIBLE; }
t_1 and t_2 are the remaining times for players 1 and 2, respectively. I'd like to change the color of the text to red to warn a player when his time falls below 60 seconds. It seems as though it should be possible to do this using pan_setvar(), but I haven't been able to figure out how, and there are no examples of this. Any advice will be appreciated.
Dr. Phillip M. Feldman
|
|
|
Re: how to change text color?
[Re: pfeldman]
#221467
08/14/08 07:44
08/14/08 07:44
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
I think you'll need to use one or two TEXT* objects. Check the manual, but they function very like the digits commands, but they are separate objects to the panel, so you'll need to position the TEXT objects over the top of your panel.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: how to change text color?
[Re: Scorpion]
#221532
08/14/08 15:01
08/14/08 15:01
|
Joined: Jul 2008
Posts: 1,178 England
MrGuest
Serious User
|
Serious User
Joined: Jul 2008
Posts: 1,178
England
|
if it's always consistent then set it directly PANEL* panDisplay= { digits(100, 300, "# 1: %0.1f", "Arial#60b", 1, t_1); digits(450, 300, "# 2: %0.1f", "Arial#60b", 1, t_2); red = 255; green = 0; blue = 0; flags= VISIBLE; }
|
|
|
Re: how to change text color?
[Re: MrGuest]
#221571
08/14/08 21:25
08/14/08 21:25
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Both Scorp and MrGuest are right but have missed the point that the request for different lines of the panel have different colors. The code they supplied will set the color for the text of the whole panel, so unless you put two separate panels right next to each other it wont help. Unless of course, I've misunderstood the question and so apologise.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: how to change text color?
[Re: LazyDog]
#221789
08/16/08 13:26
08/16/08 13:26
|
Joined: Jul 2005
Posts: 187
lostzac
Member
|
Member
Joined: Jul 2005
Posts: 187
|
I have been following this topic since it started, and you know I never even thought of using draw_text....lol....Thats a good idea and probably the best way of handling something like this. KUDOS to you LazyDog
John C Leutz II
|
|
|
|