GUI Label Question [SOLVED]

Started by BD, Thu 18/04/2019 04:16:39

Previous topic - Next topic

BD

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

Khris

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?

BD

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

Khris

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
  lbltxt.Text = "Some message";

BD

( 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

SMF spam blocked by CleanTalk