PDA

View Full Version : Issues with Positioning



eschlon
December 22nd, 2010, 11:37
Hi all, just getting started with FG and I'm having some issues with anchoring not producing the results I expect. The goal of this exercise is to produce a box on the character sheet using the sheetbox frame and then put a vertical separator in said box.

I've created and stored the separator as an icon, it generally displays fine but the positioning is weird (this happens with any icon, not just the one I created, so I don't think it's an issue with the icon).

Here's the relevant code:


<genericcontrol name="theFrame">
<bounds>10,90,275,150</bounds>
<frame>
<name>sheetgroup</name>
</frame>
</genericcontrol>

<genericcontrol>
<anchored>
<to>theFrame</to>
<position>insidetopleft</position>
<offset>50,50</offset>
</anchored>
<icon>vseparator</icon>
</genericcontrol>

The idea is that this would create a sheetgroup frame with the graphic set to offset 50px x & y from the top left.

Instead I get a huge stretched icon hanging around outside of the the sheetgroup frame (in a roughly top-left area). I've attached an image of what I'm talking about (using the standard d10icon instead of the separator for clarity).

esc

drahkar
December 22nd, 2010, 14:19
To properly help with this we also need the framedef for the frame you are using. But so far it looks fairly right. Is the icon larger than 50 pixels?

eschlon
December 22nd, 2010, 15:55
Huh, things seem to be working as expected now... I had to explicitly define the size of the icon. I could swear I'd already tried that, but perhaps not.

The icon in question is 15x125 (the die in the picture above is 25x25). I understand how explicitly defining size in the anchor tags would help. What I still don't fully grasp is why the code above would make the icon gigantic and place it above and to the left of the intended location, while adding in the size tags makes it normal sized (as expected) and appear below and to the right of the intended location (also as expected).

If it's of interest, the framedef is the standard for the 3.5e sheetgroup.


<framedef name="sheetgroup">
<bitmap file="frames/sheetgroup.png" />
<topleft rect="0,0,18,18" />
<top rect="18,0,512,18" />
<topright rect="530,0,17,17" />
<left rect="0,18,18,512" />
<middle rect="18,18,512,512" />
<right rect="530,0,17,512" />
<bottomleft rect="0,530,18,17" />
<bottom rect="18,530,512,17" />
<bottomright rect="530,530,17,17" />
</framedef>

esc