Jibble

Author Topic: GUI Label Question [SOLVED]  (Read 488 times)

BD

  • I got the big dumb
    • I can help with animation
    • I can help with story design
    • I can help with web design
GUI Label Question [SOLVED]
« on: 18 Apr 2019, 04:16 »
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
« Last Edit: 22 Apr 2019, 20:51 by BD »

Khris

  • having to deal with what games are going through
    • Lifetime Achievement Award Winner
    • I can help with play testing
    • I can help with scripting
    • I can help with translating
    • Khris worked on a game that was nominated for an AGS Award!
Re: GUI Label Question
« Reply #1 on: 18 Apr 2019, 07:26 »
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

  • I got the big dumb
    • I can help with animation
    • I can help with story design
    • I can help with web design
Re: GUI Label Question
« Reply #2 on: 18 Apr 2019, 13:04 »
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

  • having to deal with what games are going through
    • Lifetime Achievement Award Winner
    • I can help with play testing
    • I can help with scripting
    • I can help with translating
    • Khris worked on a game that was nominated for an AGS Award!
Re: GUI Label Question
« Reply #3 on: 18 Apr 2019, 16:10 »
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: Adventure Game Studio
  1.   lbltxt.Text = "Some message";

BD

  • I got the big dumb
    • I can help with animation
    • I can help with story design
    • I can help with web design
Re: GUI Label Question
« Reply #4 on: 22 Apr 2019, 19:33 »
( 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