Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (TipmyPip, AndrewAMD, dBc), 18,430 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Text color in text array? #245828
01/12/09 09:14
01/12/09 09:14
Joined: Jul 2008
Posts: 54
Taipei, Taiwan
PlaystationThree Offline OP
Junior Member
PlaystationThree  Offline OP
Junior Member

Joined: Jul 2008
Posts: 54
Taipei, Taiwan
Hi guys, I'm trying to create a text array to create texts with the same string but different colors. Here's my script:

Code:
 #include <acknex.h>
#include <default.c>

TEXT* textArray[10];

var i = 0;
function main(){
	var tempy = 10;
	while(i<10){
	textArray[i] = txt_create(1,2);
	(textArray[i])->pos_x = 10;
	(textArray[i])->pos_y = tempy;
	((textArray[i])->pstring)[0] = "Some String";
	(textArray[i])->red = random(255);
	(textArray[i])->green = random(255);
	(textArray[i])->blue = random(255);
	(textArray[i])->flags = VISIBLE;
	tempy+=10;
	i++;
}
}


That's my full script. However, all the texts stay the default white. Any ideas?


Bet you don't know where Taiwan is lol.

"The Lord is my light and my salvation..." Psm 27:1
Re: Text color in text array? [Re: PlaystationThree] #245832
01/12/09 09:41
01/12/09 09:41
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
add this after text array:

FONT* font_arial = "Arial#12";

and this in your while:

(textArray[i])->font = font_arial;

seems like you cant color bitmap fonts, and the default font is a bmap font.

Last edited by Quadraxas; 01/12/09 10:30.

3333333333
Re: Text color in text array? [Re: Quad] #245835
01/12/09 09:48
01/12/09 09:48
Joined: Jul 2008
Posts: 54
Taipei, Taiwan
PlaystationThree Offline OP
Junior Member
PlaystationThree  Offline OP
Junior Member

Joined: Jul 2008
Posts: 54
Taipei, Taiwan
Thanks a million Quadraxas. It's working exactly as its supposed to. Thanks again!


Bet you don't know where Taiwan is lol.

"The Lord is my light and my salvation..." Psm 27:1

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

Gamestudio download | 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