Weiß jemand ob bzw. wie man das in AGS umsetzen kann?

Code: Alles auswählen
String Character.Name
Gets/sets the name of the character, as set in the AGS Editor. This is the full name, not the script name.
Code: Alles auswählen
player.Name = Game.InputBox("Wie heißt Du?");
Code: Alles auswählen
function on_key_press(int keycode) {
...
if (keycode==13) { // return
if (gNameprompt.Visible && lblName.Text!="") {
player.Name=lblName.Text;
gNameprompt.Visible=false;
}
}
}
Code: Alles auswählen
player.Say("Hallo, ich bin %s!", player.Name);
Ging bei mir auch nicht. Dann habe ich das in interface_click() getan:Mister L hat geschrieben:Bei dem GUI mit Textbox hab ich jetzt das Problem, dass ich die Eingabe in der Textbox nicht mit Return beenden kann.
Code: Alles auswählen
if (interface == NAMEPROMPT) {
if (gNameprompt.Visible && lblName.Text!="") {
player.Name=lblName.Text;
gNameprompt.Visible=false;
player.Say("Du heisst: %s", player.Name);
}
else player.Say("Du hast nix eingegeben!");
}
If a text box is on a currently displayed GUI, all standard keypresses (ie. letter keys, return and backspace) are diverted to the textbox instead of being passed to the on_key_press function. When the player presses Return in the text box, the interface_click function is called with the text box's GUI and object number. You can then use the TextBox.Text property to retrieve what they typed in.
Code: Alles auswählen
gNameprompt.Visible=false;
player.Name=lblName.Text;