Gamestudio Links
Zorro Links
Newest Posts
MinMax function on History t6 file
by LucasJoshua. 11/21/26 14:28
What are you working on?
by rayp. 11/20/26 18:10
FXCM => AVA Trade Plugin???
by Martin_HH. 11/17/26 17:02
contractUpdate() is filtering if >2 rows
by mistery. 11/09/26 12:06
New Zorro version 3.15
by jcl. 11/09/26 09:24
Removing outliers from files
by jcl. 11/04/26 10:30
[MED] Import from FBX (2010) missing!!!
by rayp. 11/03/26 14:33
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (AndrewAMD), 42,010 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EvanTJ, rht, MaliceTheMaker, Haitao_Ren, JimSimons
19250 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