text== sometin, Code Help?

Game Editor comments and discussion.

text== sometin, Code Help?

Postby Oman » Wed Jun 27, 2007 2:47 pm

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
"Beyond a wholesome discipline, be gentle with yourself." - Max Ehrmann
User avatar
Oman
 
Posts: 268
Joined: Tue Oct 31, 2006 4:00 am
Location: Somewhere out there...
Score: 6 Give a positive score

Postby metal_pt » Wed Jun 27, 2007 4:30 pm

Try this:

Code: Select all
if (strncmp(HUD_text.text, "hello",5) == 0)
{
    VisibilityState("Event Actor", DONT_DRAW_ONLY);
}
]v[eta[_ - Using GE since June, 15 2007
Currently using v1.3.8 Registered
metal_pt
 
Posts: 117
Joined: Sat Jun 16, 2007 12:57 pm
Location: Sintra, Portugal
Score: 2 Give a positive score

Postby Game A Gogo » Thu Jun 28, 2007 12:24 am

@ 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.
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby Oman » Thu Jun 28, 2007 6:00 pm

i cant set it to Dont draw... it needs to keep reciaving events.. :(
"Beyond a wholesome discipline, be gentle with yourself." - Max Ehrmann
User avatar
Oman
 
Posts: 268
Joined: Tue Oct 31, 2006 4:00 am
Location: Somewhere out there...
Score: 6 Give a positive score

Postby Oman » Thu Jun 28, 2007 6:05 pm

oh... nvm... thank you game a gogo :D
"Beyond a wholesome discipline, be gentle with yourself." - Max Ehrmann
User avatar
Oman
 
Posts: 268
Joined: Tue Oct 31, 2006 4:00 am
Location: Somewhere out there...
Score: 6 Give a positive score

Postby Oman » Thu Jun 28, 2007 6:06 pm

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.)
"Beyond a wholesome discipline, be gentle with yourself." - Max Ehrmann
User avatar
Oman
 
Posts: 268
Joined: Tue Oct 31, 2006 4:00 am
Location: Somewhere out there...
Score: 6 Give a positive score

Postby Oman » Thu Jun 28, 2007 6:13 pm

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
"Beyond a wholesome discipline, be gentle with yourself." - Max Ehrmann
User avatar
Oman
 
Posts: 268
Joined: Tue Oct 31, 2006 4:00 am
Location: Somewhere out there...
Score: 6 Give a positive score

Postby Game A Gogo » Thu Jun 28, 2007 11:08 pm

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"
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby Oman » Fri Jun 29, 2007 12:47 am

oh, ok tyvm
"Beyond a wholesome discipline, be gentle with yourself." - Max Ehrmann
User avatar
Oman
 
Posts: 268
Joined: Tue Oct 31, 2006 4:00 am
Location: Somewhere out there...
Score: 6 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron