Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Chicky on Mon 24/06/2013 23:38:01

Title: Displaying a GUI in line with a display message box
Post by: Chicky on Mon 24/06/2013 23:38:01
Hello faithful Internet family! I have a game making question.

I'm trying to display a small image in the bottom right of my message box for the display command, I'm looking to have a looped animation play, like in traditional RPG's. Is there a way to retrieve the x and y coordinates of a text window edge? Or maybe the bottom right of a text window GUI?

I'm guessing after getting the coordinates I'll be able to check if the text window GUI is on and display another GUI with the graphic at the x and y. Am I looking at this the right way? I have a habit of doing these things ass backwards :)

Mucho thanks!
Title: Re: Displaying a GUI in line with a display message box
Post by: Chicky on Wed 03/07/2013 19:27:42
Does anyone have any tips? Sorry for the bump, i'm a bit stumped on this one!
Title: Re: Displaying a GUI in line with a display message box
Post by: Khris on Wed 03/07/2013 19:33:51
Afaik, using Display halts the engine completely. Even if there was a way to get the coordinates, you still couldn't use them anywhere.
The only way to do what you want is to create your own message box, I'm afraid.
Title: Re: Displaying a GUI in line with a display message box
Post by: Ghost on Wed 03/07/2013 20:01:05
Quote from: Khris on Wed 03/07/2013 19:33:51
Afaik, using Display halts the engine completely.

Confirmed. It's an auto-pause. And the next click will remove the display panel.
Title: Re: Displaying a GUI in line with a display message box
Post by: Chicky on Wed 03/07/2013 21:19:18
Ack, okay i'll look into creating my own message box :) I was using the 'New text window GUI' option previously, is there any documentation for setting up a normal GUI as a text window?

Thanks for help :)
Title: Re: Displaying a GUI in line with a display message box
Post by: Khris on Wed 03/07/2013 23:15:51
Not really, but you can resize and center the label on the GUI according to GetTextWidth/Height, and as for the borders, create DynamicSprites from the border sprites and put them on there using buttons, too.

I actually created this very thing for a project once (on ice): http://www.youtube.com/watch?v=GPCY3JGu0JU

It's not just a module though, it's going to need some preparation (2 GUIs, etc.)
Let me clean it up a bit and write a short how to. Might take me some time though, if you can wait a few days.

It does this "slide in from and out to zero height" effect you can see in the video; you can watch the message getting typed and speed it up, wrapping doesn't make long words jump to the next line mid-word, and you can optionally leave the box on the screen to show the next message if you have lots of lines to show. And it has a semi-transparent background :)
I basically wanted to come as close to Chrono Cross as possible.
Title: Re: Displaying a GUI in line with a display message box
Post by: Chicky on Wed 03/07/2013 23:54:07
Awesome Khris, that would be a great help! I was looking for a way to have the text box expand on height and width when it opens, so the Chrono Cross style example will be invaluable :)

I wasn't really trying to imitate the RPG vibe (i've saved that for a parody battle mechanic), but was playing Kingdom Hearts and got inspired by their GUI design. I've made a pseudo battle system that uses inventory items as weapons, i'm using it as a puzzle mechanic so all the actions are pre scripted. Would be interesting to have a look at how you made your timer!

Thanks again Khris!