Adventure Game Studio | Forums

AGS Support => Beginners' Technical Questions => Topic started by: BD on Thu 18/04/2019 04:16:39

Title: GUI Label Question [SOLVED]
Post by: BD on Thu 18/04/2019 04:16:39
Hello!

In my game I have a GUI (gtxtwindow) with a label(lbltxt) and a text parser (which is already set up). What I would like to do is have the user type something and have the Label display a response ; below is how the display is set up. I know the code for displaying text in the gui label but not when prompted ( if that makes any sense)  Any help would be much appreciated! 

https://gyazo.com/7bc4c328043de060212ce1992aca66d6
Title: Re: GUI Label Question
Post by: Khris on Thu 18/04/2019 07:26:41
I assume you're already using the TextBox's OnActivate function? In there is where you parse the text, then display the response.
You say you've already set up the parser, how exactly?
Title: Re: GUI Label Question
Post by: BD on Thu 18/04/2019 13:04:17
Here are some snips of my parser code ; I'm not at my computer to copy it directly atm

https://gyazo.com/582808e2ed7587cd8e7cdbeb33b485fa

https://gyazo.com/1fdb1819b059eb54d647cc4f6961d26b

right now it displays over the players portrait which is fine , but I'm just not sure how to put some in the label area
Title: Re: GUI Label Question
Post by: Khris on Thu 18/04/2019 16:10:47
All you need to do is add text to the label in the code block that deals with the response to a successful parsing.
In the first snippet you have  CallRoomScript(1);  so in your room script, inside the  on_call  where you deal with the command, you simply add something like

Code (ags) Select
  lbltxt.Text = "Some message";
Title: Re: GUI Label Question
Post by: BD on Mon 22/04/2019 19:33:06
( Sorry for the delayed response. Happy Easter!)

Thank you so much, it works!
In my head I thought it would have been much more difficult