Text color in text array?

Posted By: PlaystationThree

Text color in text array? - 01/12/09 09:14

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?
Posted By: Quad

Re: Text color in text array? - 01/12/09 09:41

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.
Posted By: PlaystationThree

Re: Text color in text array? - 01/12/09 09:48

Thanks a million Quadraxas. It's working exactly as its supposed to. Thanks again!
© 2024 lite-C Forums