0 registered members (),
1,103
guests, and 1
spider. |
Key:
Admin,
Global Mod,
Mod
|
|
|
enter text
#215817
07/13/08 15:12
07/13/08 15:12
|
Joined: Aug 2006
Posts: 152 vector(200,45,338)
Marwan
OP
Member
|
OP
Member
Joined: Aug 2006
Posts: 152
vector(200,45,338)
|
I have a string that carries up to 50 chars , how can I devide it into several lines instead of filling it during runtime in one long line
like when the first line is filled with 10 chars it automaticly jumps to the line below and so on and also how can I make it apear like that when I re open it later
THANKS FOR READING
age:16
game design and
programming
experience:2 years
|
|
|
Re: enter text
[Re: Marwan]
#216275
07/16/08 09:18
07/16/08 09:18
|
Joined: Jan 2006
Posts: 968
EpsiloN
User
|
User
Joined: Jan 2006
Posts: 968
|
I'm not shure I understood what you want You can type "\n" in your text for a new line (but I'm not shure this works). You could also check the length of your string and split it in smaller sections. str_len(string) if > 10 than copy the string into a new one , clip 10 characters from the first string , trunc (str_len - 10) from the second string. You get the rest of the text in the first string , and the first line of text in the second string. Repeat the process for more strings.
|
|
|
Re: enter text
[Re: EpsiloN]
#216286
07/16/08 10:36
07/16/08 10:36
|
Joined: Aug 2006
Posts: 152 vector(200,45,338)
Marwan
OP
Member
|
OP
Member
Joined: Aug 2006
Posts: 152
vector(200,45,338)
|
What I ment is , instead if writing a text like this:
example:
whats up mom , Im going to school today , dont foget to give me my sandwiches and when I comeback I will do my HW etc etc etc etc bla bla bla bla bla bla
I want it like this
example:
whats up mom , Im going to school today , dont foget to give me my sandwiches and when I comeback I will do my HW etc etc etc etc bla bla bla bla bla bla
age:16
game design and
programming
experience:2 years
|
|
|
Re: enter text
[Re: Marwan]
#218319
07/27/08 22:28
07/27/08 22:28
|
Joined: Apr 2006
Posts: 159 Latvija
Arrovs
Member
|
Member
Joined: Apr 2006
Posts: 159
Latvija
|
get it to seen next time after game open is easy with file=file_open_read("valoda.dat"); and further information can get with file_str_read(file,string);//and other ways because it stops in , and other stupid simbols and in this case you can use read_to! Example:
val_dok = file_open_read("valoda.dat"); // open language file valoda = file_var_read(val_dok); //read which language is set file_close(val_dok); varonis_dat = file_open_read("varonis.dat"); // open info file file_find(varonis_dat,"Vards:");//find this name and put cursor behind it file_str_readto(varonis_dat,strIevadesfin,",IP:",null);//read name till "IP:" text! file_find(varonis_dat,"IP:");//find this text and put cursor behind it file_str_read(varonis_dat,strIP); // and read which IP is inputted file_close(varonis_dat);
In this way you can read any text from start till your own maded end string.
And now how to do this writing in game time from my opinion:
function input_check { if(str_len(txt_str)=10) {str0=create_string("#10"); str0.sring=txt_str;//set second string pos to first string inkey_active=off; //and now first to next line txt_str=str0.pos_y+str0.char_y;//if need put some more pixels str_cpy(txt_str,""); input(); } }
funtion input { input_check(); inkey(txt_str); //after enter fails=file_open_write(fails.dat);//save result file_str_write(fails,txt_str);//use if or anything else to check other maded or defined strings file_str_read(fails,"!END#$%");//your read end part to let read all commas and other stupid reading breakers. file_close(fails); }
for short version is good, but much to improve(almost not tested, but if you know how to do programming all will be good).
Arrovs once will publish game
|
|
|
|