Most flags can be used by all *Def Types, but some are used only by certain *Def elements. The following is an example of a choiceDef and some of its flags to show the general set up:
choiceDef gametype_selection { rect 118,4,170,22 visible 1 cvar si_gametype font "fonts/lowpixel" forecolor 1,1,1,0.8 textscale 0.26 values "DM;Tourney;Team DM;CTF;Arena CTF" choicetype 1 choices "Deathmatch;Tourney;Team Deathmatch;Capture the Flag;Arena CTF" }
backcolor
Defines the background color of the windowDef. Colors are normalized RGB and alpha values. A backcolor set to 1,1,0,1 would be yellow with no transparency. This flag can also reference the individual R,G,B and alpha values in the following way: backcolor_x, backcolor_y, backcolor_z, backcolor_w.
background
The path to the image to be displayed in the windowDef. Paths are referenced from q4base, so a typical path would be gfx/guis/mapname/imagename .
bind
Used in bindDefs. Sets the bind that will be changed when the player edits their key bindings.
bordercolor
Defines the color of the border on a windowDef. Colors are normalized RGB and alpha values. A bordercolor set to 1,1,0,1 would be yellow with no transparency. The bordersize flag must be set for a bordercolor to show. This flag can also reference the individual R,G,B and alpha values in the following way: bordercolor_x, bordercolor_y, bordercolor_z, bordercolor_w.
bordersize
Defines the size in pixels of the windowDef's border.
choices
Defines the choices to be shown in a choiceDef. Each choice is separated by a semicolon.
choicetype
- Takes values of 0 and 1. Choicetype 0 is a boolean value. Choicetype 1 is a multiple choice value.
comment
- Used to mark a comment. This is often used in the Desktop to refer to gui parms that may be used by the GUI to operate on scripts.
cvar
Defines the cvar that the windowDef is bound to. This can be used for editDef, choiceDef, and sliderDef.
descriptions
Sets the text to be displayed alongside each choice in a popupDef. Descriptions are separated by semicolons.
dpadgui
- When set to 1 on a world GUI, this marks it as having navigable elements via the D-pad.
font
Sets the font to be used for the text in that windowDef.
forecolor
Defines the color of the text in a windowDef. Colors are normalized RGB and alpha values. A forecolor set to 1,1,0,1 would be yellow with no transparency. This flag can also reference the individual R,G,B and alpha values in the following way: forecolor_x, forecolor_y, forecolor_z, forecolor_w.
high
Used in sliderDefs as the upper boundary for a slider cvar value.
listname
Used in listDefs only. Sets the name of the list to be displayed in the listDef. This listname value is referenced by the code and may or may not be different from the listDef's actual name.
low
Used in sliderDefs as the lower boundary for a slider cvar value.
matcolor
Defines the color of the image displayed in the “background” flag for a windowDef. This flag can also reference only the R, G, B, and alpha values of a windowDef accordingly: matcolor_x, matcolor_y, matcolor_z, matcolor_w.
menugui
- Used in the Desktop. A value of 1 marks the gui as a menu gui. This adjusts the cursor pointer size. Without this flag, menus will have giant cursors similar to world guis.
name
nocursor
- Used in the Desktop. A value of 1 will display no cursor over the gui. This can be used for noninteractive GUIs such as monitors.
noevents
notime
Used for windowDefs holding animation scripts. A value of 1 stops the windowDefs onTime scripts from running.
rect
Defines the location, width and height of a windowDef as x1,y1,width,height. 0,0,640,480 would be a windowDef of 640 by 480 pixels whose top left corner is at coordinate 0,0. The first two values always represent the upper left corner of a windowDef.
rotate
Defines the angle that the image refenced by the windowDef will be rotated. This property can also be used in a transition statement to rotate an image in a windowDef over time.
scrollbar
A value of 1 enables scrollbars in a listDef.
step
Used in sliderDefs to define the interval that a slider will move.
text
The text to be displayed in the windowDef. The character limit is 1024.
textalign
Defines the alignment within the windowDef of the text. A value of 0 left-aligns the text. A value of 1 center-aligns the text. A value of 2 right-aligns the text. When this flag is not set, the text defaults to left-aligned.
textscale
Defines the font size of the text in the windowDef. The range is general from 0.0 to 1.0 but can exceed 1.0.
thumbShader
Used only for sliderDefs. This references an image to be used as the slider element.
visible
Takes values of 0 or 1. Defines whether or not the windowDef is visible. windowDefs have a visible set to 1 by default.
matscalex
When set to -1, this will flip the texture in the windowDef along the horizontal axis.
matscaley
When set to -1, this will flip the texture in the windowDef along the vertical axis.