Forums

Please or Register to create posts and topics.

GFX layout

Editing GFXs: Layout.txt

You need: WarDraft
A Text Editor

This how to make a completely new layout.txt file for your GFX, explained on each line of a standard layout.txt file:

 

 

  • Always add pixels at the lower and right edge, never at the upper or left!# Conversion information for "anyfile.gfx" -> "anyfile.bmp"
    # This textfile serves as input to the reconverter, but
    # you can also use it as reference when editing the BMP
  • The # sign hides the "text following it" from the converterTYPE=0
  • the above line designates the type of GFX, war2 alpha uses a different type, as well as Warcraft 1, and the war2 symbol graphicsNUMICONS=1
  • The above is the number of frames in the GFX. A footman would have NUMICONS=60 HINT= 0-59ICONSPERROW=1
    XSPC=1
    YSPC=1
  • the above 3 lines deal with how the frames are placed in the bmp. It can be changed while conversion, don't change it in the layout.txtBGCOL=255
  • The above line designates which palette index is used for the background color. it can be specified during conversion so it doesn't really matter. This is NOT the transparent color, but the background color(usually white)MAXW=72
  • The above line has the maximum width in pixels it is the maximum width of the actual frames, not the width of the bmp they are in.MAXH=72
  • The above line has the maximum height in pixels, same concept as MAXWADJUST=0
  • This is if you have activated the "Use adjustment values in bmp" 0=deactivated 1=activated
    HINT: When editing a gfx with a lot of frames(e.g. units) it's easier if you deactivate this option in the Graphics converter DO NOT change this later in the layout.txt or your gfx might screw up
  • BMP composition:
    (icon) (width) (height) (position in BMP); (X-,Y-Adjust)
    0         72       72        (0,0) - (71,71);      0 0
  • HINT:
    If a person is pushed off a HIGH building, they scream "WHY?!" while they are falling to their doom, because: X = Width, Y = Height ...
  • (icon) 0 means that it is the first icon, a footman has frame numbers 0-59 unlike WarDrafts GFX viewing utility which counts from 1-60
  • (width) 72 says that that frame(frame 0) is 72 pixels wide
  • (height) 72 says that that frame(frame 0) is 72 pixels high
  • (position in BMP); (0,0) - (71,71);
    (Xbegin,Ybegin) - (Xend,Yend); is broken into 2 parts
    The first part (0,0) - is the starting coordinates (X,Y); this is the coordinates for the top-left corner of the frame.
    The second part (71,71); is the ending coordinates (X,Y); this is the bottom-right corner of the frame
    HINT: WarDraft's Reconverter doesn't use the end coordinates
  • notice that the width, "X" is from 0-71, which equals a total of 72 pixels for the width for the frame, and the height, "Y"is from 0-71, which equals a total of 72 pixels
    Now take another look:

(icon) (width) (height) (position in BMP); (X-,Y-Adjust)
0         72       72        (0,0) - (71,71);      0 0

  • The (X-,Y-Adjust) is the offsets for centering the frame inside of the MAXW and MAXH, see below for formulas to figure the stuff out..
  • General formulas to calculate all this numbers:MAXW=J
    MAXH=K
    (icon) (width) (height) (position in BMP); (X-,Y-Adjust)
    A        B         C         (D,E) - (F,G);        H I
  • A = the frame number
  • B = (F - D) +1
  • C = (G - E) +1
  • D = Beginning X coordinate of frame
  • E = Beginning Y coordinate of frame
  • F = Ending X coordinate of frame Not used by the reconverter, no need to change it
  • G = Ending Y coordinate of frame Not used by the reconverter, no need to change it
  • H = (J/2) - (B/2) or H = (J-B)/2
  • I = (K/2) - (C/2) or I = (K-C)/2
  • The formulas for H and I are just for buildings, ships, cannons and all that stuff. If you want to do the adjustment for a walking unit, you can also use this for generally center the frame, but you'll have to do some changes manually if you don't want the unit to "jump" around. I always take screenshots of all frames I want to change and then count the pixels of a specific point which doesn't change in any sequence(i.e. head) to the edge of the box. Be aware that you don't screencapture the mirrored frames for northeast,east and southeast.
  • If you need to have a lower adjustment than 0, NOT use negative adjustment(you'll get really strange effects), you have to change the MAXH(or MAXW), but then you also have to change the adjustment of the other frames. You then have to add the half of what you added to MAXW(MAXH) to each adjustment value for weidth(height). In example when you change the MAXH from 72 to 88 (plus 16) then you have to add 8 to each Y adjustment. It's not hard if you really understand the system of layout.txt's but if you don't it can ruin the whole layout.txt, so make a backup before you try around with this and don't do it if you already have problems with doing layout.txt's without such little tricks.HINT: "H" sets the frame to the right, "I" down.
  • If these formulas are used, then you shouldn't have problems making an oversized GFX, but remember that the box size may need to be changed via UDTAed in order to avoid trails from oversized graphics. If you still have problems, then email me
  • If you just aren't able to put something into GFX send me and I probably can do it for you, but if I do this I'd like to reserve the right to use this GFX as template for my own(But I'll write that I used yours as template in the additional credits section).Originally created by Brian Sawatzky
    Additions and changes by Fronzel Neekburn (me)

    This pages realized by this friendly hosts:

 

 

Uploaded files:
Thanks! Tupac Administrator