Hi guys,
I've had a long time away from AGS and am super rusty - I'm using AGS 3.6.1.24 for the first time to play around with something - and I can't get the onkeypress function to work properly from within a textbox. I just want the player to be able to type their name and press the Return key, then the game moves on.
As an example, i've put this in globalscript on_key_press as I normally would (the textbox is included within gPassword)
if(gPassword.Visible == true)
{
if(keycode == eKeyReturn){
//code here
//eg
Display("Done!");
}
but instead of displaying "Done!", nothing happens. Am I doing something stupid? The keypresses work fine if a textbox is not displayed on the screen
Apologies, super rusty!
Shaun
TextBoxes eat all keypresses, so on_key_press is never called. Instead you have to use the TextBox.OnActivate event (from the event pane in the GUI editor).
Welcome back, BTW!
Ah of course!! Thank you Snarky :D