|
1 registered members (1 invisible),
1,558
guests, and 3
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Draw_text problem
#260247
04/09/09 17:55
04/09/09 17:55
|
Joined: Jul 2004
Posts: 1,710
MMike
OP
Serious User
|
OP
Serious User
Joined: Jul 2004
Posts: 1,710
|
Hello guys what wrong with this?? i cant figure out...
i made a function for debugging.. and each time i call it, there is this string that is shown on screen, and i added a variable to make it scroll down so they wont overlay.
The problem is.. im calling the function with diferent parameter, and they apeaar all the same? What im doing wrong??
var sn_y=88; //pos on screen y void show_number(var dx){ sn_y+=15; var sn2=sn_y+15;
STRING* tt="#100"; str_for_num(tt,dx);
while(1){ draw_text(tt,300,sn2,vector(90,90,90)); wait(1);} }
then i call on main: show_number(10); show_number(50); show_number(100);
BUt the result on screen is :
100 100 100
and not 10 50 100
Why?
Last edited by MMike; 04/09/09 18:10.
|
|
|
Re: Draw_text problem
[Re: MMike]
#260251
04/09/09 18:06
04/09/09 18:06
|
Joined: Aug 2003
Posts: 7,440 Red Dwarf
Michael_Schwarz
Senior Expert
|
Senior Expert
Joined: Aug 2003
Posts: 7,440
Red Dwarf
|
var sn_y=88; var multiplier=0;
void show_number(var dx){ STRING* tt="#100"; multiplier++; str_for_num(tt,dx); var a = sn_y + (15 * multiplier); while(1){ draw_text(tt,300,a,vector(90,90,90)); wait(1);} }
Last edited by Michael_Schwarz; 04/09/09 18:06.
"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
|
|
|
Re: Draw_text problem
[Re: MMike]
#260255
04/09/09 18:44
04/09/09 18:44
|
Joined: Aug 2003
Posts: 7,440 Red Dwarf
Michael_Schwarz
Senior Expert
|
Senior Expert
Joined: Aug 2003
Posts: 7,440
Red Dwarf
|
i would go for a string array about now... would limit the number of element you can show, but it also takes away lots of frustration.
"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
|
|
|
Re: Draw_text problem
[Re: Michael_Schwarz]
#260268
04/09/09 21:01
04/09/09 21:01
|
Joined: Jul 2004
Posts: 1,710
MMike
OP
Serious User
|
OP
Serious User
Joined: Jul 2004
Posts: 1,710
|
but why is happening? it sholdnt behave that way
i declare a internal string, and the text displays that string , its not an global string? is this a bug or something? in not on the text draw.. its on another things..its an internal problem that must be a bug. i will report.
>>because check this:
void return_number(var number){ STRING* tt="number"; str_for_num(tt,number); while(1){error(tt); wait(1);} }
now on main...
return_number(10); return_number(20);
This should make the engine , error output 10, and then 20, and then 10 and then 20, endless.. but thats not what happens, you get, 10, then 20, then 20 forever, 10 will disapear wuhuhu..
|
|
|
Re: Draw_text problem
[Re: MMike]
#260281
04/09/09 22:57
04/09/09 22:57
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
HAve a look in you bugs post.... Your return_function is bad.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|