rich_is_bored@Posted: Wed Jul 07, 2004 5:55 am :
Introduction

I think it's time I wrote up a more complete Command Reference for GUIs. But I need everyone's help.

I'm starting a thread here in hopes that it takes on the form of a wiki. Of course this means that people with rights to edit threads can edit changes into this post.

If you don't have rights but would like to make a contribution just make a post below and someone will append it.

Hopefully this will serve well as a means to populate BNA's database with definitions.

GUI Command Reference

backcolor
...Description -
This command defines the color of your window and transparency.
...Syntax -
Code:
backcolor   <red>,<green>,<blue>,<alpha>;


background
...Definition -
This command defines the tga or material to use as the background for this window.
...Syntax -
Code:
background   "<Directory/FileName_MaterialName>";


bordersize
...Definition -
This command defines the size border to draw around a window. A size of 0 would mean no border.
...Syntax -
Code:
bordersize   <Value>;



caption

definevec4

else
...Definition -
This command is part of an conditional statement. The commands enclosed in brackets are exectuted when the above if statement evaluates to false.
...Syntax -
Code:
else {
...code...
}


float
...Definition -
This command defines a variable as a floating point number.
...Syntax -
Code:
float   <Variable> "<Value>";


font
...Definition -
This command defines the font to use in blocks of text within a window.
...Syntax -
Code:
font   "<Value>";


forecolor
...Description -
This property defines the color of your foreground elements. Specifically text color, although I am sure with a name like forecolor other things are modified as well.
...Syntax -
Code:
forecolor   <red>,<green>,<blue>,<alpha>;


if
...Definition -
This command defines a conditional statement. If the statement evaluates to true the code in the curly brackets is exectuted.
...Syntax -
Code:
if   (<Conditional Statement>) {
...code...
}


invertrect

item

matcolor
...Definition -
This command appears to adjust the color and transparency of your background tga.
...Syntax -
Code:
matcolor   <red>,<green>,<blue>,<alpha>;


matscalex

matscaley

model
...Description -
This command defines the model used in the renderDef
...Description -
Code:
model    <lwo model>;


modelRotate

modelOrigin

needsRender
...Description -
Boolean 1 or 0 - whether or not the renderDef needs to be rendered. I assume this is always true, so 1. Commands to define it still apply - rect, visible, backcolor etc.
...Description -
Code:
needsRender    <0|1>;



noactivate

noclip

nocursor
...Definition -
This flag determines if a cursor is displayed in the current window.
...Syntax -
Code:
nocursor   <Value>;


noevents
...Definition -
This appears to be a flag that designates whether the engine should dedicate attention to a window. It is set when a window will not play a role in the gui's function. Its value can be a 0 or 1.
...Syntax -
Code:
noevents <value>;


notime

nowrap

nozorder

onAction
...Description -
This is a listener that triggers when the mouse clicks within the perimeter of a window. It is opened and closed with curly brackets. You code the commands you wish to execute on that event within the curly brackets.
...Syntax -
Code:
onAction {

...code...

}


onEsc

onEvent

onMouseEnter
...Description -
This is a listener that triggers when the mouse enters the perimeter of a window. It is opened and closed with curly brackets. You code the commands you wish to execute on that event within the curly brackets.
...Syntax -
Code:
onMouseEnter {

...code...

}


onMouseExit
...Description -
This is a listener that triggers when the mouse exits the perimeter of a window. It is opened and closed with curly brackets. You code the commands you wish to execute on that event within the curly brackets.
...Syntax -
Code:
onMouseExit {

...code...

}


onTime

onTrigger

rect
...Description -
This command defines the size and location of a window. It is usually follows a windowDef.
...Syntax -
Code:
rect   <XPosition>,<YPosition>,<Width>,<Height>;


renderDef
...Description -
Like windowDef but for models rather than image/text.
...Description -
Code:
renderDef rendername{
...
}


resetTime
...Definition -
This command resets the timer for a window so that it can repeat an animation.
...Syntax -
Code:
resettime   "<Value>";


set
...Description -
This command allows you to set the value of a property or key related to this specific gui entity.
...Syntax -
Code:
set "<WindowName, Gui or CMD>::<Value>" "<NewValue>";


Note: There is a special case when using the set command. Take a look at the example below.

Code:
set "cmd" "activate";


In this case I am passing a command to the engine. When I use the cmd reference I am passing a command that will not affect the gui but trigger an event in the game. The command "activate" triggers the chain. The gui will signal whatever is assigned to its target key(s). Then those targets will perform their functions.

I can also tell the engine to trigger a sound. Look at the example below.

Code:
set "cmd" "play guisounds_click";


In this case I am passing the play command to the engine. Now the sound guisounds_click will play. I can also call multiple commands in the same statement. Look at the next example.

Code:
set "cmd" "activate; play guisounds_click";


All I need to do here is separate the commands with semicolons.

showtime

text
...Description -
This flag is a reference to a string of text you would like displayed in your window.
...Syntax -
Code:
text   "<string>";


textalign
...Description -
This flag determines whether the text is centered right or left justified. Somebody help fill in the gaps here. I think 1 makes the text center justified.
...Syntax -
Code:
textalign   "<value>";


textaligny

textscale
...Description -
This flag determines the scale of your text.
...Syntax -
Code:
textscale   "<value>";


transition
...Description -
This command modifies the value of a flag or property gradually over time. In other words, it "transitions" between two groups of settings. It is used to script an animation.
...Syntax -
Code:
transition "<WindowName or Gui>::<Value>" "<Starting Settings>" "<Ending Settings>" "<Time in Milliseconds>";


Note: Look at the example below.

Code:
transition "Down::matcolor" "1 1 1 0.2" "1 1 1 0.9" "200";


NOTE: In this case I am telling the gui to adjust a property on the window "Down". The property I am adjusting is matcolor. The initial settings are "1 1 1 0.2" and the final settings are "1 1 1 0.9". It will perform the transition within 200 milliseconds.

visible
...Definition -
This is a flag that determines whether a window is visible or not. Its values can be a 0 or 1.
...Syntax -
Code:
visible <value>;


windowDef
...Description -
This command defines a window in your gui. Each element of an interface, the buttons, the backgrounds, the monitor glow, ect is its own window. It must be opened and closed with curly brackets.
...Syntax -
Code:
windowDef <WindowName> {

...code...

}



BNA!@Posted: Wed Jul 07, 2004 8:06 am :
Double thumb up!



kazahana@Posted: Sat Aug 14, 2004 7:44 pm :
I've been playing around with MainMenu.gui. It's fantastically compex. I've been trying to get the player model on the main menu, but to no avail. I think the model attribute of renderDefs has to be lwo and not md5.

model
...Description -
This command defines the model used in the renderDef
...Description -
Code:
model    <lwo model>;


modelRotate

modelOrigin

needsRender
...Description -
Boolean 1 or 0 - whether or not the renderDef needs to be rendered. I assume this is always true, so 1. Commands to define it still apply - rect, visible, backcolor etc.
...Description -
Code:
needsRender    <0|1>;


renderDef
...Description -
Like windowDef but for models rather than image/text.
...Description -
Code:
renderDef rendername{
...
}



Eutectic@Posted: Fri Sep 17, 2004 6:30 am :
Just a quick FYI rich (in case you don't already know)


background
...Definition -
This command defines the tga or material to use as the background for this window.
...Syntax -
Code:
background   "<Directory/FileName-MaterialName>";


The background parameter can also point to a shader/material if you want a scrolling, pulsating, deforming or rotating background images



MNeMiC@Posted: Fri Sep 17, 2004 10:58 am :
looks good, one question though, whats A WIKI, I've seen it in lots of places, can't figure out what it's short for,,,,



rich_is_bored@Posted: Fri Sep 17, 2004 3:41 pm :
I'm not sure if it's an acronym or not. What i do know is it's supposed to be a document that can be updated / edited by it's readers.

In that sense it's not really a wiki because a mod has to edit your changes in.

And on that note, I'll go ahead and add/edit the posts above in. :)

EDIT: Done. You're definitions / corrections have been added. Thanks all.



zeh@Posted: Fri Sep 17, 2004 3:49 pm :
Well, I've also been updating the other reference with lots of stuff. I haven't added this thread it to the tut/ref listing because I don't consider it complete yet.. I recon there are half a dozen properties I still have to add there (and others I still need to write the description as well). I think we need to merge these two references together... be it on this thread or there.



rich_is_bored@Posted: Fri Sep 17, 2004 3:58 pm :
Sure. You're the gui guy now. :wink:

I was just keeping the seat warm waiting for you to show up. :lol:



iceheart@Posted: Fri Sep 17, 2004 8:02 pm :
zeh : If you want to I can host the gui reference on my page.



zeh@Posted: Fri Sep 17, 2004 8:24 pm :
Iceheart: thanks a lot but it belongs to d3w. :) And I see your new domain name is now working, great name!

Rich: thanks. I didn't intend to mess up with everything, although I did by posting it instead of changing yours (since I couldn't get in touch with you at the time to get permission because of your isp downtime etc). I'll better integrate the current state of your reference to the one I posted and then link it here. I expect to add a ton of content to it this weekend, including several topics raised by Eutectic.