Page 1 of 1

text== sometin, Code Help?

PostPosted: Wed Jun 27, 2007 2:47 pm
by Oman
Okay, i put this in my draw actor of my text actor "HUD_text"

if (strcmp(HUD_text.text, "hello") == 0)
{
VisibilityState("Event Actor", DONT_DRAW_ONLY);
}

then i typed in the text box, hello , but my HUD_text isn't disappearing,

Please help

PostPosted: Wed Jun 27, 2007 4:30 pm
by metal_pt
Try this:

Code: Select all
if (strncmp(HUD_text.text, "hello",5) == 0)
{
    VisibilityState("Event Actor", DONT_DRAW_ONLY);
}

PostPosted: Thu Jun 28, 2007 12:24 am
by Game A Gogo
@ Metal_pt: Thats just the same code :P

@ Oman: You to set it to "DONT_DRAW" because when you set it to "DONT_DRAW_ONLY" there is a bug that happens, and it still shows the text.

PostPosted: Thu Jun 28, 2007 6:00 pm
by Oman
i cant set it to Dont draw... it needs to keep reciaving events.. :(

PostPosted: Thu Jun 28, 2007 6:05 pm
by Oman
oh... nvm... thank you game a gogo :D

PostPosted: Thu Jun 28, 2007 6:06 pm
by Oman
ok, i got that... now how do i make the text change colors.

(like in the demo version it says "made with game editor", i want to make it change colors like that.)

PostPosted: Thu Jun 28, 2007 6:13 pm
by Oman
actually i found that out to... i used this code...

Code: Select all
int rcolor;
int gcolor;
int bcolor;
rcolor = rand(255);
gcolor = rand(255);
bcolor = rand(255);
r = rcolor;
g = gcolor;
b = bcolor;


i seem to be answering my own questions

PostPosted: Thu Jun 28, 2007 11:08 pm
by Game A Gogo
actually, you could do the same thing whit out declaring a variable.
Code: Select all
r=rand(255);
b=rand(255);
g=rand(255);


and for making somewhat smooth movement:

Code: Select all
r=cos(i);
b=sin(i);
g=sin(i*3);
i+=.05;


remember to create the var inside the variable thingy, since somehow, it doesnt do it when it is declared inside the code. and make it a "real"

PostPosted: Fri Jun 29, 2007 12:47 am
by Oman
oh, ok tyvm