Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: kantor_98 on Wed 01/03/2006 10:32:59

Title: Word input
Post by: kantor_98 on Wed 01/03/2006 10:32:59
I want to ask the main character for something and I don't want if predefined (I will check in the game if what he give is OK). Has anybody a small script for introducing words (not more than 10 letters) ?
Title: Re: Word input
Post by: Ashen on Wed 01/03/2006 11:12:51
If you're using 2.7 (which I guess you are (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=25364)), you could use InputBox(),  e.g.:

string temp;
InputBox("Who are you?", temp);
Display ("Hello, %s", temp);

For 2.71, that's been replaced with Game.InputBox (http://www.adventuregamestudio.co.uk/manual/Game.InputBox.htm), but works similarly.

If you want to customise the input box GUI, you're going to have to make your own using a TextBox GUI object (http://www.adventuregamestudio.co.uk/manual/GUI%20Text%20Box%20functions%20and%20properties.htm). (Online manual entries refer to 2.71 - look them up yourself for 2.7)