Just a few minutes after my last question, I have to ask another one (hope you won't blame me for that =D). But I am working on a High Score System which works fine so far, but I need to know how I can create something which lets the player enter his name...Maybe a field or something like that.
Hope you'll understand my request.
Greetz, Minamato
Re: Enter Name for Highscore
[Re: Minamato]
#327680 06/07/1020:0906/07/1020:09
There was a function which saves the last pressed key. You could ask for the last pressed ones and display them at the same time, so it would be the same as writing. First you have to display a panel to write or something like that. Don't know the code exactly right now.
-h34dl4g
1338, beyond leet.
Re: Enter Name for Highscore
[Re: Minamato]
#327681 06/07/1020:1006/07/1020:10
Use a TEXT with a string and make this TEXT visible. Now use "inkey(my_string)" and you can edit this string. The script waiting during you edit the string. If you press enter (or esc, tab and others, see manual) the script continues.
Re: Enter Name for Highscore
[Re: Widi]
#327740 06/08/1011:1206/08/1011:12
#include <acknex.h>
#include <default.c>
STRING* string1 = "";
STRING* string2 = "";
STRING* entry_str = " "; // long empty string
TEXT* name_show =
{
pos_x = 50;
pos_y = 50;
layer = 1;
font = "#16";
string(string1);
flags = SHOW;
}
TEXT* name_show2 =
{
pos_x = 50;
pos_y = 50;
layer = 1;
font = "#16";
string(string2);
flags = SHOW;
}
function process_entry(STRING*)
{
while(1)
{
if (inchar(string1) == 13) break;
str_cat(string2,string1);
}
}
function main ()
{
video_mode = 7; // Bildschirm der Größe 1280x800
mouse_mode = 4; // aktiviere Maus
var key = inkey(entry_str); // wait until [enter] pressed
if (key == 13) process_entry(entry_str);
}
which of the three strings is the one which displays the name in the end? When I use them in my highscore-send function, the show nothing, allthough the name was displayed before (while entering it)...
greetz, Minamato
Re: Enter Name for Highscore
[Re: Minamato]
#327845 06/08/1020:2306/08/1020:23
You call this function with this string as parameter: process_entry(entry_str); but in this function is notting to take this parameter: function process_entry(STRING* my_str) Now use str_cpy to copy the entry_str in the string1 or string2 str_cpy(string1,entry_str);
Last edited by Widi; 06/08/1020:24.
Re: Enter Name for Highscore
[Re: Widi]
#327853 06/08/1020:4506/08/1020:45