Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: rtf on Sat 13/03/2004 21:51:47

Title: Display GUIs
Post by: rtf on Sat 13/03/2004 21:51:47
OK, I've searched the forums and searched the help[ file, but I still don't know how to make your own custom DISPLAY GUI, like in Pleurghburg or 5DAS.

IF anyone could help me, I would be darn fine with it.  :)
Title: Re:Display GUIs
Post by: Pumaman on Sat 13/03/2004 22:12:38
Sorry, what do you mean by a "Display GUI"?
Title: Re:Display GUIs
Post by: Ginny on Sat 13/03/2004 22:20:57
Do you mean the textbox GUI that pops up on the Display command? or do you mean a screen of some computer or tv?
Title: Re:Display GUIs
Post by: rtf on Sun 14/03/2004 00:42:23
Quote from: GinnyW on Sat 13/03/2004 22:20:57
Do you mean the textbox GUI that pops up on the Display command? or do you mean a screen of some computer or tv?

I meant the textbox GUI.

I should have been more clear with that one...   ::)
Title: Re:Display GUIs
Post by: Robert Eric on Sun 14/03/2004 01:50:13
In the GUI editing tab, there is a button that says "Create New GUI".  While this new GUI is selected, click on the checkbox somewhere at the top of the screen that says "Text Window".  The GUI should now have eight buttons around the corners; these are called borders.  You can now use your own sprites (images) for these, but keep in mind that the sizes for these should all be the same.  Just click on the buttons and edit the image.
Title: Re:Display GUIs
Post by: rtf on Sun 14/03/2004 02:11:07
Thanks, Robert

One more thing:

Is there a special line of code that I should put in the global script so that the RTA identifies this as the default display box?
Title: Re:Display GUIs
Post by: Robert Eric on Sun 14/03/2004 02:42:39
Click on the General Settings tab, and you should see a check box that says, "Text Windows use GUI".  Then, in the text box that follows, type in the GUI number of the text window.  If you want to change which gui to use as a text window during the game, just use the SetTextWindowGUI function, which you can find more about in the help manual.
Title: Re:Display GUIs
Post by: rtf on Sun 14/03/2004 02:59:13
Woo-Hoo!

Thanks mucho, Robert!
Title: Re:Display GUIs
Post by: rtf on Sun 14/03/2004 17:16:29
Oh, no!

I am trying to use my own image for the backround of the text box, but the DISPLAY() text is coming out stretching the size of the GUI.
I even tried adding a text box to it to see if that would help.  No luck.

Also, I am getting like 25 blue cups surrounding the text box when I test the game.
Why?

So can someone tell me is I can fit the text into the size of the GUI that I want?  Or maybe there is a piece of code that I can put into the script that makes the "CUstom Image" text box stretch to fit the words?

Thanks
Title: Re:Display GUIs
Post by: Pumaman on Sun 14/03/2004 17:54:11
You need to define border graphics as well as a background - if you haven't set the border graphics, you'll get blue cups.

The background image itself isn't tiled or anything, so it needs to be at least about 250x150 so that it will always be big enough for the text window.
Title: Re:Display GUIs
Post by: rtf on Sun 14/03/2004 20:25:33
Adivice straight from the head honcho himself.

The image fits perfectly, but I still am getting a stretched out grey backround instead of having the text inside the box.
Title: Re:Display GUIs
Post by: Ginny on Sun 14/03/2004 22:08:00
Make sure the foreground color (i.e. text) is different from the background color/image, maybe that's why you don't see the text? Most likely that's not the problem though, so could you specify a bit more what the problem is? Does the GUI stretch more than it should with the amount of text on it? Are the borders working?
Title: Re:Display GUIs
Post by: rtf on Tue 16/03/2004 22:38:04
OK.  Here is how it should look like (The text is in the middle, obviouisly):

(http://www.2dadventure.com/ags/DisplayBox.png)


...and here is what it is turning out to be like:

(http://www.2dadventure.com/ags/tst.png)

as you can see from the images, my problem is clear  ;)
Title: Re:Display GUIs
Post by: Robert Eric on Wed 17/03/2004 01:54:53
Is that the background you are trying to use, or what it looks like in the game with the border sprites?
Title: Re:Display GUIs
Post by: rtf on Wed 17/03/2004 02:16:42
if you are referring to the white backround, then no, I just diddn't crop the 2nd image.

And the first image, in case I wasn;t clear with it, is the Text Box for messgaes.
Title: Re:Display GUIs
Post by: Gilbert on Wed 17/03/2004 02:40:38
Hmmm did you check the "text box" checkbox in that gui? Check it first. Text boxes are handled specially, unlike the "common" GUIs.
Title: Re:Display GUIs
Post by: rtf on Wed 17/03/2004 02:58:50
yeah, it was checked already

i would get an error message otherwise, right?


maybe I should just forget the whole thing  :'(
Title: Re:Display GUIs
Post by: Darth Mandarb on Wed 17/03/2004 06:14:46
"Never give up ... NEVER surrender"
- Peter Quincy Taggart, Commander of the NSEA Protector

Make sure first and foremost that the background image you're using for the text window doesn't include any of the border elements (or it won't look right 100% of the time)

These are the pieces (graphics) you need to create:
╔ - top left
═ - top and bottom middle (don't have to be the same)
╗ - top right
║ - middle left and right (don't have to be the same!)
╚ - bottom left
╝- bottom right
[edit](those were supposed to be symbols of each piece ... but they're not working??)[/edit]

It appears as if the text isn't staying within the border (which is why it made me think the background image contained some of the border elements)

Maybe upload a screen-cap of the GUI inside the editor?

~ d
Title: Re:Display GUIs
Post by: Pumaman on Wed 17/03/2004 21:10:07
Yep it sounds like Darth is saying - your background image doesn't include the border graphics, does it?
Title: Re:Display GUIs
Post by: rtf on Thu 18/03/2004 00:48:51
I haven't implemented Darthy's suggestion yet, but I happen  ;) to have a screenshot of the GUI in the editor.

(http://www.2dadventure.com/ags/GUI_in_editor.PNG)





I will not double post, i will solely edit this post when I have tried what was suggested to me.
Title: Re:Display GUIs
Post by: CB.. on Thu 18/03/2004 11:44:47
it kind of looks like the textbox is bigger than the GUI?
could yu use a smaller text box area (say enough for just three words) test it if it's any better than gradually increase the size of the text box untill the problem occurs..

is it possible to wordwrap in a textbox?
Title: Re:Display GUIs
Post by: Gilbert on Fri 19/03/2004 02:04:42
I think he really drew the whole frame onto the background image, and he hadn't checked it yet.

And no, I'm not impressed.
Title: Re:Display GUIs
Post by: Pumaman on Fri 19/03/2004 17:41:05
You've imported a single background image for the GUI. This is not how text windows work, because they can be all sorts of different sizes. You need to import seperate border sprites for left, right, top, bottom and each corner, and then assign them.

Darth explained this further.
Title: Re:Display GUIs
Post by: rtf on Sat 20/03/2004 03:40:12
Oooohh!!!!!!!!!!!!!

Now I get it!  hehehe duh!
it works, and I'm happy!



Big ol' thanks for everyone's help!!!!