Gathering the Assets

Before we can start creating menu scripts we have to gather together some graphics and create some text files that are necessary for the menu system to run. To simplify this, it would be very helpful if you had Team Arena or the Team Arena Demo in order to extract the required graphics. If you don't have either of these then you can download a package of graphics here that can be used instead.

Assets

The following are the graphics that are loaded by the menu system at startup. These must be provided or the menu system will not function properly (or at all). Some of the graphics are from the vanilla Quake 3 pak files, while others are unique to Team Arena and must be provided by the user.

Quake 3 Files

These graphics are contained in the stock Quake 3 pak0.pk3 file. You can use custom versions of these graphics by placing them in the appropriate sub-directory of baseq3.

The fx graphics from directory menu\art. The names and location of these files is changable in the menu script but by default they are loaded from this directory using these names.

  • fx_base.tga
  • fx_blue.tga
  • fx_cyan.tga
  • fx_grn.tga
  • fx_red.tga
  • fx_teal.tga
  • fx_white.tga
  • fx_yel.tga

The 10 crosshair graphics from directory gfx\2d

  • from crosshaira.tga to crosshairj.tga

Team Arena Files

These files are unique to Team Arena and must extracted from the TA pak file or supplied by the user. In the TA pak file these graphics are in the ui\assets directory. The names and location of these files is changable in the menu script but by default they are loaded from this directory using these names.

  • gradiantbar2.tga - used when filling a menu window with a gradiant color
  • scrollbar.tga - used as the background of the scrollbars. This graphic must be square and it is stretched horizontally or vertically to fill the scrollbar area. This is the default background for both horizontal and vertical scrollbars but in the menu scripts you can define a different graphic for each.
  • scrollbar_arrow_dwn_a.tga - the down arrow for a vertical scrollbar
  • scrollbar_arrow_up_a.tga - the up arrow for a vertical scrollbar
  • scrollbar_arrow_left.tga - the left arrow for a horizontal scrollbar
  • scrollbar_arrow_right.tga - the right arrow for a horizontal scrollbar
  • scrollbar_thumb.tga - the thumb for the scrollbar. It is used for both horizontal and vertical scrollbars and should be square as it drawn square to fit on the scrollbar.
  • slider2.tga - the background for a sliderbar. Sliders are all drawn horizontally and the background is streched to fit the defined slider size.
  • sliderbutt_1.tga - the thumb for the sliderbar. This graphic is streched to fit the defined height and width for the thumb.

The following sizes are used by default for scrollbars and sliders. These can be changed in the menu script to suit the graphics that you are using.

  • scrollbar width (for horizontal scrollbars) or scrollbar height (for vertical scrollbars) is 16.
  • slider width is 96 and slider height is 16. The background for the slider is stretched to fit this size.
  • slider thumb width is 12 and the slider thumb height is 20. The slider thumb is stretched to fit this size.

Text Files

In order for the program to know what menu script files to load you must supply some text files that contain a list of names and locations of these files. For the menus used for the main (non-ingame) menus this text file is called menus.txt and must be located in the ui directory. For the ingame menus this file is called ingame.txt and is also located in the ui directory. Each text file has the identical format so we will look at only the menus.txt file here.

   {
     loadMenu { "ui/main.menu" } 
     loadMenu { "ui/quit.menu" }
   }

The loadMenu commands must be placed between curly braces ( "{" and "}" ), one command per line. Each loadMenu command specifies a path and name of a menu script file we wish to load. Team Arena uses the .menu extension to designate a menu script file but any extension can be used.

Here we are telling the program to load and use two menu script files, main.menu and quit.menu, both in the ui directory. Only these two script files will be used by the program in the non-ingame menu system, regardless of how many other script files are present in the directory. Similarly, only the menu script files specified in the ingame.txt file will be used by the ingame menu system.

Important Note : the order that the menus are loaded is critical. The menus are drawn in the order that they are loaded, with the first loaded drawn first and the last loaded drawn last. If you are using popup menus or menus overlayed on other menus then these menus must be loaded after the menus they popup or are overlayed over. Ignoring this can cause strange behavior, with popup menus not appearing when they should or overlay menus not showing. A good rule of thumb is to place the loading of all popup or overlay menus at the end of the list.

 

Return to Home Page