Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, alibaba), 1,184 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
How do I give digits color? #277497
07/09/09 12:28
07/09/09 12:28
Joined: Mar 2006
Posts: 321
Norway
Eagelina Offline OP
Senior Member
Eagelina  Offline OP
Senior Member

Joined: Mar 2006
Posts: 321
Norway
How do I add color to the letters and numbers in this:

//number of books
digits(100,100,"Books: %.0f",("Arial#20"),1,got_books);
digits(180,100,"/ %.0f",("Arial#20"),1,max_books);

As it is now it is only showing the text and number in the color white. I whant to be able to give it more color.


A6 and A7 Commercial
-------------------
Programmer always searching for more to learn and understand. smile
Re: How do I give digits color? [Re: Eagelina] #277509
07/09/09 12:56
07/09/09 12:56
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Digits get their color from the panels background color.
mypanel.red, .green, .blue
So all the digits get the same color.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: How do I give digits color? [Re: EvilSOB] #277511
07/09/09 13:00
07/09/09 13:00
Joined: Mar 2006
Posts: 321
Norway
Eagelina Offline OP
Senior Member
Eagelina  Offline OP
Senior Member

Joined: Mar 2006
Posts: 321
Norway
But I dont have them on a panel, only showing directly in the game.

And I am shure it is a way to "control" the color, but I cant find it mentioned anywhere....


A6 and A7 Commercial
-------------------
Programmer always searching for more to learn and understand. smile
Re: How do I give digits color? [Re: Eagelina] #277513
07/09/09 13:01
07/09/09 13:01
Joined: Mar 2006
Posts: 321
Norway
Eagelina Offline OP
Senior Member
Eagelina  Offline OP
Senior Member

Joined: Mar 2006
Posts: 321
Norway
And what shall I use if I whant to have colored text showing in the game?


A6 and A7 Commercial
-------------------
Programmer always searching for more to learn and understand. smile
Re: How do I give digits color? [Re: Eagelina] #277518
07/09/09 13:14
07/09/09 13:14
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Then use TEXT*.

Re: How do I give digits color? [Re: Cowabanga] #277519
07/09/09 13:30
07/09/09 13:30
Joined: Mar 2006
Posts: 321
Norway
Eagelina Offline OP
Senior Member
Eagelina  Offline OP
Senior Member

Joined: Mar 2006
Posts: 321
Norway
so I must add another line wiht text? Isent there any ways to integrate this into digits().....? Like to compress the codes... smile


A6 and A7 Commercial
-------------------
Programmer always searching for more to learn and understand. smile
Re: How do I give digits color? [Re: Eagelina] #277521
07/09/09 13:39
07/09/09 13:39
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
You can use 'text' instead of 'digits' and use 'str_for_num' to get the var as string to show it in the text. That's at least the only way I know.

Re: How do I give digits color? [Re: Eagelina] #277522
07/09/09 13:40
07/09/09 13:40
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Now, do you want the text colored or the amount or both??

Re: How do I give digits color? [Re: Cowabanga] #277523
07/09/09 13:41
07/09/09 13:41
Joined: Mar 2006
Posts: 321
Norway
Eagelina Offline OP
Senior Member
Eagelina  Offline OP
Senior Member

Joined: Mar 2006
Posts: 321
Norway
Bouth text and numbers needed to be colored.


A6 and A7 Commercial
-------------------
Programmer always searching for more to learn and understand. smile
Re: How do I give digits color? [Re: Eagelina] #277526
07/09/09 13:52
07/09/09 13:52
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Here's the code (Tested):
Code:
TEXT* books_word = 
{
	pos_x = 100; //Edit this
	pos_y = 100; //Edit this
	font = "Arial#20";
	string = ("Books:");
	red = 50;
	green = 50;
	blue = 140;
	flags = SHOW;
}

PANEL* books_amount = 
{
	digits(135,100,5,"Arial#20",1,got_books); //Edit this
	digits(170,100,"/ %.0f","Arial#20",1,max_books); //Edit this
	flags = SHOW;
	red = 40;
	green = 80;
	blue = 225;
}



Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1