Back



 
Basics

First and foremost.
Aug.24.2003 - 5:23 pm

This is my first Ags tutorial, hell, my first tutorial period so treat me nice and I will do my best. I will try to cover Guis and explain them since most people are confuzzled.

Basics

Let's get going!
Aug.24.2003 - 5:23 pm

(Basic stuff skip if you know GUI basics)

Hold on there turbo. Lets make sure you know what your doing in the first place. I would suggest creating a back-up of your game or starting a new game to play with. You don't have to but hey if you screw somethin up don't come crying to me with your boo-hoos and fix-me's.

Now that your game is open and your ready to go open the GUI menu (AGS - Game Editor - GUI). And you will be confronted with something like this:



Get back here now don't be scared its only the GUI Editor. Now on your immediate left we have a list (GUI 0, GUI 1). This is there so you can scroll through all your Guis. The Two standard ones AGS comes with shall be there. Down at the bottom ( not shown in the above pic) is a couple buttons.

[ Create NEW GUI ] Try making a new GUI. Just click this button and there ya go the list will have a new GUI in it. Careful once you create one you can't delete. But you can edit it as much as you want once created so you aren't completely screwed. :)

[ Import GUIs ] This is a nice feature to make loading previous GUIs you have made or ones other people have made. First you must export it.

[ Export GUIs ] This will export the current GUI you have selected. so if you work for hours on a GUI and want to use it again for another game or give it to all your friends save it here.

[ Edit Script ] This is a sort of short-cut key. You can assign GUI objects scripts to run at appropriate times. But sense you have no idea as to what that means just think of it as the big red button you shouldn't push yet. Don't push it...DON'T!

Moving on. Remember the GUI list? Yeah, go back there and if you didn't create a new GUI do it now. On a new game your new GUI would be GUI 2 this may be different but select the last GUI on the list. This should be a long dark GUI. There should be a little Pop-up window that looks like this:


Now we are getting ahead of our self here but I need you to change something. See where it says Height 13 ? Click on the 13 and change it to a higher number like 100 to give us more room to work with. Now it should be taller. Giving a lot more room to work with (super...).

Back on track. In the following as I explain what each feature does try drawing it on your new big gui and having a look at them. Notice how the above Pop-up window changes each time you draw something. (DON'T TOUCH!) just look. anyways...The toolbox:



From left to right:
[ Add GUI button ] Use this to add a button on your GUI. What is a button good for? Well all those little squares in the toolbox pic above are buttons. In GUI 1 all those nice boxes are buttons. Basically they are good to do simple commands. Like Yes or No, Open another GUI, Change the mouse cursor...

[ Add GUI label ] This is a simple way to get text on your GUI. Good for labels, Displaying the players score, Game info or whatever you want (more on this later).

[ Add GUI textbox ] A textbox is used when you want the player to type something in. Good for parsers, Getting info from the character or if you want to make a word processor (and you don't wanna do that...Ok?).

[ Add GUI slider ] A slider is used for setting volume levels, game speed, Difficulty level...whatever you want.

[ Add GUI list box ] Much like our list box for GUIs on the left (GUI 0, GUI 1, GUI 2) this lists whatever you want. Good for displaying file names in a Load/Save Gui, or whatever you feel like making a list of.

[ Add GUI inventory window ] If you aren't happy with AGSes Inv. GUI (and why the hell not?) this is your new best friend. Though a small bit of scripting know how will be needed to customize it.

Simple huh? Alright what about the little options around the tool box right? Clickable, Text window and Snap Objects to...? Well you can hold your mouse over it and it will tell you but I guess I will too.

[ Clickable ] When this is on (checked) it means you can click on the gui and its buttons and so forth. Well whats the point? Lets say you had a gui that all it did was say the players score. You have no need to click on it an perhaps in your game something will be behind it the player needs to click on. Trust me it's a good option.

[ Text Window ] When you display text in ags in a narrative fashion or use the Display script command a nice (ugly) white GUI pops up. If you would like to create your own prettier Gui for this create it and turn Text Window on.

[ Snap Object to... ] Well the name pretty much says it all. To make sorting and positioning your GUI objects easier turn this on. For small or precise changes you may need to turn this off.

Okay one last thing and we can take a break I promise. Click on the grey area of the GUI (Make sure none of the objects.. Buttons, Labels...ect are selected. You can tell if they are selected cause they will have yellow dots in the corners) anyways to see if the gui is Selected look at the Pop-up window:

See at the top where it says GUI 0 (0 Objects). Yours should read GUI 2 (5 Objects) or GUI 3 (2 Objects) or whatever. If it says something like GUI 2 Object 1 (Button) or some other object with like Label or whatever in parenthesis in it then you don't have the GUI selected. The easiest way to select the GUI if you have lots of Objects on it (Objects are Buttons Labels, Text boxes...ect incase you didn't catch on). Easiest way is to click on the purplish area on the right and bottom of the GUI. If you can't get the GUI selected then all hope is lost and you should just throw yourself out the window. NO! (yes) NO! (ok)...but seriously if you can't get it take a break or something.

Moving on...The above pop-up window is all the GUIs options. Most are pretty self explanatory but hey Its my job to explain them right?

[ Background Color ] This is the Background color of the GUI. The number that is on there is used to get a color off the palette. if your game is 8-bit then you have to make the palette yourself but 16-bit it is pre-made. The first 30 colors or so should be the same either way so try changing the number to 1, 10 or 7 and see the results. If you set the color to 0 the GUI will be transparent allowing you to see through.

[ Background Image ] Don't want just a solid color? Well import an image into the sprite editor and you can use it as your BG image here. AGS will not stretch or change the image for you to fit your GUI so make sure it is the right size before setting it in your GUI.

[ Foreground Color ] This will change the color of the border of your GUI. yup that's about all...sorry

[ X-postion/Y-Postion ] This changes where the GUI is displayed on screen in an x, y manner. X moves the Gui horizontally (left and right) and Y moves it vertically (up and down). Careful with this if you set it too high and ags tries to display even a small part of your GUI off the screen it will crash.

[ Width/Height ] Pretty much says it all but the important part here is for the above option (X/Y position) Subtract your Width by 320 and your Height by 200 and the resulting number is your limit for X Y. HUH? okay in the above Pop-up window it says your Width is 319 and Height is 13. 320 - 319 = 1, 200 - 13 = 187. this means you cannot set the X-position higher then 1 and the Y-position higher then 187 or ags will crash. It's simple trust me.

[ Visible ] If you double click on this a small list box will pop up with Three options. Always on means when your game starts the gui will be on. Mouse YPos means it will only come on when the mouse goes to whatever place you wish. Script Only means the GUI will only turn on if you Script it to turn on.

[ Mouse YPos ] Unless the above option is set to Mouse YPos this will say N/A (Not Applicable you mule). the lower this number is set the higher the mouse will need to go on the screen to trigger the GUI. So if it is set to 5 the mouse will need to go to the very top to turn on the GUI (much like most Ags games) if you set it to 200 however it will always be on because the mouse is always in position. Make sense...Yeah I donno either don't worry bout it too much.

Now if you click on each GUI Object (like a button) then this Pop-up will change. Most of the options are the same and serve a similar purpose but you would decompose before explaining them all. So I suggest toying with them and figuring it out (fear not they won't bite....).