PDA

View Full Version : How to save a Frame (Image)



Meliora
September 23rd, 2007, 13:31
I hope this is a very simple question and I am just stupid, but what file type do I have to save an image in, such as the background for character sheets.

It seems that no matter what file I choose it want to merge my items together and thereby prevent it to be transparent.

Dachannien
September 23rd, 2007, 13:43
PNG is probably the format you want for preserving transparency.

Meliora
September 23rd, 2007, 14:47
That is what I did :D, but just did it wrong....I had to save for web, instead of a normal save.

Thank you.

Now to other questions *grins*. Should probably make a new thread, since it is another issue, but it is still about the same. I thought I had it figured, but I don't.

1) Can anyone explain how I decipher these numbers under the file graphic_frames (what does each of the four number in each line stand for). The codes are taken from the default ruleset:


<framedef name="charsheet">
<bitmap file="frames/charsheet.png" />
<topleft rect="0,0,22,22" />
<top rect="22,0,481,22" />
<topright rect="503,0,22,22" />
<left rect="0,22,22,567" />
<middle rect="22,22,481,567" />
<right rect="503,22,22,567" />
<bottomleft rect="0,589,22,22" />
<bottom rect="22,589,481,22" />
<bottomright rect="503,589,22,22" />
</framedef>

Is this the file I have to change to use a bigger picture, like if I have just increase the size of the Character sheet? Let's say I only increased the width from 525 pixels to 1000 (just an example. A 1000 is just used for the ease to see if there really was a change).

2) First I was playing around in the file Charsheet_Toplevel, line 23 and 24.

<windowclass name="charsheet">
<frame>charsheet</frame>
<placement>
<size>
<width>525</width>
<height>611</height>
</size>
What are those lines for?

3) And the same in Charsheet_Main, line 45 and 46


<windowclass name="charsheet_main">
<placement>
<size>
<width>252</width>
<height>611</height>
</size>
</placement>

What are those lines for?

Sorry for being such a noob, but is completly new to this (played with it for an hour or so). Hope that I soon will see the light

At least I figure out how to change and add new skills...yeah me

Foen
September 23rd, 2007, 14:59
Each of the lines in the frame definition has (in order) an x-position, a y-position, a width and a height. Thus in <right rect="503,22,22,567" />, the area starts at position (x=503,y=22) and is 22 pixels wide by 567 high.

Pixel co-ordinates are relative to the top left corner of the image (0,0).

The various sections in the frame definition are used for stretching the frame. The corners are rendered as-is, the edges are repeated or truncated, and the middle is tiled. This all happens from the top left hand corner of each area.

Each frame can be used for more than one windowclass (or other control) and the placement/size parameters dictate how big to draw the frame (re-sizing as mentioned above). So the frame definition says how to re-size and the windowclass definition says how big to draw that frame.

Hope that helps,

Stuart

Meliora
September 23rd, 2007, 15:02
That helped a lot...thanks. Now I just have to get my calculator and do a bit of math :) .

Foen
September 23rd, 2007, 15:34
Another thing you might bump into: some sheets are difficult to resize (changing the <size> fields doesn't seem to make any difference). If you have any problems, the first thing to try is deleting CampaignRegistry from your campaign directory (it stores window sizes and other temporary settings). Failing that, use the maximum and minimum fields for windowclass sizes, which can be found in the XML & Scripting Reference.

Cheers

Stuart

Meliora
September 23rd, 2007, 18:01
Man....I had so many problems with this...I only wanted to add a little extra space on my sheet. Changed the image size, changed all kind of size numbers in the .xml...and so on and so on. Until I found out, that one of the first thing I tried, actually worked (just had to change the size in Charsheet_Toplevel to get what I wanted)...
the problem was just, that it didn't show up because of saved window sized in Campaign Registry.

As soon as I deleted that, and tried the above again, I got it.

Thank you, Foen. I would never have figured it out, if it was not because of you.