View Single Post
Old 04-15-07, 03:37 AM   #9
zAmboni
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Deciphering menu_1024_768.ini items

Tutorial Part 3.

The first two parts of the tutorial have dealt mainly with how things are positioned within a page within the game. In this tutorial I will explain some of the other lines included for an item and how manipulating the lines can cause items to be displayed differently. In this tutorial I will do some additional manipulation of the tool helper item since it was also used in the previous two tutorials.

The first question that I will answer concerns just what elements of the tool helper item are used to determine the graphics that are displayed on the navigation menu page. The tool helper has two states, closed and open. Each state has two different graphics associated with them, one without mouseover and one with mouseover. This means that for the tool helper there are a total of four different graphics associated with it:

1)closed tool helper – no mouseover
2)closed tool helper – mouseover
3)open tool helper – no mouseover
4)open tool helper – mouseover

We can determine how these graphics are displayed by taking a closer look into the tool helper item in the menu_1024_768.ini file. Below is a portion of the tool helper item to illustrate what I am talking about. The information for where the graphics are taken for the tool helper is contained in the Mat x= and Crop x= lines. The Mat x= line shows the subfolder and the graphics file from where the tool helper graphics is found. The Crop x= lines tell what portion of this graphics file to use for the tool helper. But but but….you said above that there are 4 different graphics associated with the tool helper….why are there 8 different Mat x= and Crop x= lines? Through a bit of research I found that 4 of these lines define what graphics to use for 1 through 4 outlined above, I am not sure what the other 4 lines are for. I have noted which of the Crop x= lines are associted with 1-4 above.

[G31 I16]
Name=Tool Helper
Type=1033;Check box
ItemID=0x3101000A
ParentID=0x31010000
Pos=20,186,160,80
Zone= 20 506 160 80 0 1 0x31010001 0 0 0x3101000A 0.5 1 0 0
Materials=8
Display=0;No stretch
Mat 0=data/menu/gui/layout/navigationtools.tga
Crop 0=0.673828,0.859375,0.0683594,0.0390625
Mat 1=data/menu/gui/layout/navigationtools.tga
Crop 1=0.673828,0.774414,0.0683594,0.0390625
Mat 2=data/menu/gui/layout/navigationtools.tga
Crop 2=0.673828,0.859375,0.0683594,0.0390625 closed tool helper – no mouseover
Mat 3=data/menu/gui/layout/navigationtools.tga
Crop 3=0.673828,0.774414,0.0683594,0.0390625
Mat 4=data/menu/gui/layout/navigationtools.tga
Crop 4=0.835938,0.859375,0.0683594,0.0390625 closed tool helper – mouseover
Mat 5=data/menu/gui/layout/navigationtools.tga
Crop 5=0.835938,0.774414,0.0683594,0.0390625 open tool helper – mouseover
Mat 6=data/menu/gui/layout/navigationtools.tga
Crop 6=0.673828,0.859375,0.0683594,0.0390625
Mat 7=data/menu/gui/layout/navigationtools.tga
Crop 7=0.673828,0.774414,0.0683594,0.0390625 open tool helper – no mouseover

For comparison, the other tools on the navmap only have two graphics associated with them. One without mouseover, and one for mouseover. I have determined that the Crop 1= line for the other tools is the graphic associated without mouseover, the Crop 2= line is the graphic used for a mouseover. Again, I have no clue what the other lines are used for.

Soooooooo….how do we decipher the Crop x= line?

The associated graphics file ususally has several different graphics used for the game. To determine just what part of that graphics file is to be used, the game uses the Crop x= line to define the x,y start position and uses the item width and height to basically make a cookie cutter box to define the graphic. Lets break down the Crop 2= line from above:

Crop 2=0.673828,0.859375,0.0683594,0.0390625

0.673828 = the x position where the graphic to be used starts. This x position is represented as the # of pixels to the right of the origin of the graphics file divided by the total width of the graphics file. The total width of the navigationtools.tga(dds) file is 1024 pixels. To find out how many pixels to go to the right, just multiply. 0.673828*1024 = 690 pixels

0.859375 = the y position where the graphic to be used starts. This y position is represented as the # of pixels down from of the origin of the graphics file divided by the total height of the graphics file. The total height of the navigationtools.tga(dds) file is 1024 pixels. To find out how many pixels to move down, just multiply. 0.859375*1024 = 880 pixels

That gives us the x,y position for the start of the graphics cut, but where do we find the width and height? You might think that the next two numbers will give you the information for the width and height, but that is not so. These two numbers (0.0683594,0.0390625) ARE INACTIVE….The width and height are inactive in the Crop x= line when the item has the line Display=0! When Display=0, the width and height are taken from the Zone= line associated with the item. In this case the width is 160 and height is 80.

For reference, here is a pic of the navigationtools.dds file with some notes:






OK, I am going to end this part of the Tutorial here. The next, and possibly final part of the tutorial will deal with the Display= line and some neato things you can do with it.
  Reply With Quote