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
3 registered members (Konsti, AndrewAMD, 1 invisible), 1,376 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İ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 | 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