PDA

View Full Version : Background on FG2?



drkknight32
June 20th, 2007, 17:11
Ok...so I'm making the ruleset. I have most of the complicated things figured out and I've begun to mess with the Combat Tracker a little bit, etc., etc.

The only thing that I can't seem to get is the background -.- . I can't seem to get it to go across the entire screen like the FG2 background. Instead it wants to tile itself. The picture is actually a little bit bigger than the desktop.png file, so I figured it wouldn't be a problem...but apparently it is.

I figure I can adjust it, but I'm not entirely sure what all of the numbers are in the graphics thread.

<decal="0,0,512,512">

(no... it doesen't say that exactly, but it does have the four numbers that confuse me)

Can anyone offer any help?

Toadwart
June 21st, 2007, 00:23
If you take a look at the desktop.png it is made up of 3 distict images (from left to right):
A - light brown wooden square
B - veritcal strip of darker brown wood
C - partially transparent grey dragon image (on a fully transparent background)

These match the 3 nodes defined in the template:
<framedef name="desktop">
<bitmap file="frames/desktop.png" />
<middle rect="0,0,512,512" /> <!-- A -->
<right rect="512,0,97,512" /> <!-- B -->
<decal rect="612,0,512,512" /> <!-- C -->
</framedef>
note: the rect tells FG which area of the graphic to use (x,y,width,height)


The right rect (B) is placed on the right-hand side of the FG desktop (and tiled vertically if it is not taller than the window height).

The middle rect fills in the remaining space (tiled vertically and horizontally if it is not big enough to fit).

The decal is then placed over top of these and centered in the middle of the desktop (this part is not tiled or scaled, just centred)

---

note: other valid nodes are:

left (same as right node but alighed on the left hand side of the desktop.
top (tiled horizontally along the top edge of the desktop)
bottom (tiled horizontally along the bottom edge of the desktop. The shortcut bar sits overtop of ths so will need to be more than 40 pixels hgh in order for it to be visible.)

kalmarjan
June 21st, 2007, 04:49
I figure I can adjust it, but I'm not entirely sure what all of the numbers are in the graphics thread.

<decal="0,0,512,512">

(no... it doesen't say that exactly, but it does have the four numbers that confuse me)

Can anyone offer any help?

Took me a while to figure it out myself. Basically it runs like this. You have the 4 numbers which represent {x,y,xwidth,yheight}.

What this means is in the case of the above code, the decal would start at 0,0 {x,y} on the png image, and create a box that is 512 x 512 px. {xwidth,yheight}

So, if you are tiling your desktop image, it is because FGII needs to fill the entire background. In the default desktop.png image, you will notice that the decal is separate from the background image. So you need to do the same.

To get your desktop image to line up right, figure out the starting x,y cordinates and the width and height of the main desktop image. Then for the decal, figure out the x,y coordinates of that section of the image, and the width and height of that. If you have a right bar that sits underneath the book icons, follow the same steps as above, or delete the entry if you do not have a bar. (No sense in leaving unused code. ;) )

I hope that clears up the confusion.

{edit} Did not see that Toadwort had already answered. Hope I did not step on your toes bud. :)
Sandeman

Toadwart
June 21st, 2007, 06:57
{edit} Did not see that Toadwort had already answered. Hope I did not step on your toes bud. :)
Sandeman

Never dude. A different viewpoint is always helpful. :D

drkknight32
June 21st, 2007, 20:39
You guys are great! I messed around with the numbers like you said and it worked out great. I'll try posting an image when I get back home tonight.