View Single Post
Old 04-15-07, 09:54 PM   #15
zAmboni
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Deciphering menu_1024_768.ini items

Tutorial Part 4.

In the last tutorial I pointed out the numbers in the Crop x= that you think would be associated with width and height were inactive. It seems that when the associated item has the line Display=0;No stretch those two numbers are inactive, and the width and height are taken directly from the Zone= line.

If you browse through the different items in the menu_1024_768.ini file, there are several different values for the Display= line, I have listed them below with some comments on them.

Display=0;No stretch – what you clip is what you get. The graphics that are defined by the Crop x= line is directly placed where the Zone= line defines
Display=1;Centered – Graphics (or text) will be placed at the center of an area defined in the Zone= line
Display=2;Linear – The graphic selection defined in the Crop x= line will be stretched/shrunk to fit the area defined in the Zone= line
Display=3;Middle – not really sure what this is for. I gather it is used the placement of text.
Display=4;All directions – not really sure what this is for either…I believe it is used for placing sliders/scroll bars
Display=5;Linear&rotation – Used for dials and other things that rotate, like the hands of the clock. It allows the stretch/shrink ability in addition for a rotation element. It appears the center of the area defined in the Zone= line is the rotation point for the item.

In the previous tutorials the items I have used for an example all were defined with a Display=0;No Stretch line. With this line included, the area of the graphics file that is “cut out” using the Crop x= line is placed, as is, starting at the placement point defined in the Zone= line. But lets now take a look at some of the other values for the Display= line, using, again, the tool helper as an example.

Lets just do a simple modification of the item and change the Display=0, to Display=1 Centered.

Hrmm….that is interesting, What happened here? OK, I’ll tell ya! Remember the width and height elements that I said were inactive in the Crop x= line? Well they are active now. In addition, the length and width elements of the Zone= line ARE ALSO ACTIVE.

[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=1;Centered
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
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
Mat 5=data/menu/gui/layout/navigationtools.tga
Crop 5=0.835938,0.774414,0.0683594,0.0390625
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

You may ask yourself, how can they both be active? Think of it this way. The width and height determined in the Crop x= line is the area that is cut out of the graphics file. The width and height determined in the Zone= file is an area that the graphic will be placed into. When Display=0, the two areas were the same size, and was define through the Zone= line.





Why is the graphics wrong in the screenshot above? That is because the width and height defined in the tool helper Crop x= lines are WRONG. If you do the math, the width defined in the Crop x= line is: 0.0683594 x 1024 = 70 pixels. The height is: 0.0390625 x 1024 = 40. In the previous tutorials we know that the length and width of the tool helper should be 160 x 80. If you notice, this smaller piece of the tool helper is pretty nicely centered in the area (160 x 80) that was defined in the Zone= line. To get things right we need to change the width and height in the Crop= line to define a cut out area of 160x80: width = 160/1024 = 0.15625, height = 80/1024 = 0.078125. Plugging this into the crop x= line gives us:

Crop 0=0.673828,0.859375,0.15625,0.078125

You will need to do the same for all of the crop x= lines.

Now I am going to take a look at the Display=2;Linear line. Lets fix all the Crop x= lines like I just mentioned and then change the Display=1 line to Display=2;Linear.

[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=2;Linear
Mat 0=data/menu/gui/layout/navigationtools.tga
Crop 0=0.673828,0.859375,0.15625,0.078125
Mat 1=data/menu/gui/layout/navigationtools.tga
Crop 1=0.673828,0.774414,0.15625,0.078125
Mat 2=data/menu/gui/layout/navigationtools.tga
Crop 2=0.673828,0.859375,0.15625,0.078125
Mat 3=data/menu/gui/layout/navigationtools.tga
Crop 3=0.673828,0.774414,0.15625,0.078125
Mat 4=data/menu/gui/layout/navigationtools.tga
Crop 4=0.835938,0.859375,0.15625,0.078125
Mat 5=data/menu/gui/layout/navigationtools.tga
Crop 5=0.835938,0.774414,0.15625,0.078125
Mat 6=data/menu/gui/layout/navigationtools.tga
Crop 6=0.673828,0.859375,0.15625,0.078125
Mat 7=data/menu/gui/layout/navigationtools.tga
Crop 7=0.673828,0.774414,0.15625,0.078125

If you fire up the game, you wont notice anything different. Well that is because the area defined in the Zone= line and the Crop x= line is the same. But let’s double the length and width defined in the Zone = line:

Zone= 20 506 320 160 0 1 0x31010001 0 0 0x3101000A 0.5 1 -80 0

(Note: I used an offset because the tool will get shifted to the right a bit).




You can see now that the graphic defined in the Crop x= line now is stretched to fit the larger area. You can use this to increase the size of a graphic on a page. You can also make the graphic smaller by changing the width/height in the Zone= line to an area smaller than one defined in the Crop x= line.

Im not going to talk about the Display=3;Middle and Display=4;All directions options because I am not sure what they do. They do weird things to if you plug it into the tool helper item above.

I’m only going to touch upon the Display=5;Linear&rotation option. I haven’t played around with it, so I am not sure if what I would say is right or wrong J. From what I can tell, it is used for dials and hands of clocks or other things that rotate. The center of rotation for the dial would be the center of the area defined in the Zone= line. As far as I can tell, the option works the same as the Display=2;Linear. So you can zoom or shrink a graphics by playing with the width/height in the Zone= line. Just make sure that you adjust the offset that may be caused by changing the width/height in the Zone= line.

I think I am going to end the tutorials here….mainly because I really don’t know anything else about the items in the menu_1024_768.ini file….and I need to get geared up for getting back into the game when the patch comes out this week! .If you have found anything else out about the items in the file, you are welcome to add it in the thread or add your own tutorial on how to mod things J.
  Reply With Quote