Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: arrtisste36 on Fri 02/01/2009 03:28:34

Title: GUI Text Box Help
Post by: arrtisste36 on Fri 02/01/2009 03:28:34
How do I use a GUI text box in my game?  I want to make it so that something will happen when the player keys in the correct password.  How do I do this?  I've looked through the tutorials and I can't find anything?
Title: Re: GUI Text Box Help
Post by: Dualnames on Fri 02/01/2009 15:19:17
First of all you can use a GUI and put a text box in it. Make sure the GUI is closed when the gam begins. Now when you want it open do this:

gTextBox.Visible=true;

on the textbox's activate section put this:

if (txtbox.Text=="password") {
//do something
}
else {
//say password is wrong ecc
}
txtbox.Text="";//so that next time the GUI password opens player doesn't have to delete text.
Title: Re: GUI Text Box Help
Post by: arrtisste36 on Fri 02/01/2009 15:36:39
Thank you, that was very helpful!  ;)