PDA

View Full Version : offset in framedef?



Blacky
August 10th, 2013, 19:16
Does anyone uses the offset and insideoffset parameters in the <framedef> definition?

Even after reading 5 times the official doc on that, I'm not quite sure what that does or how it works…

Moon Wizard
August 10th, 2013, 19:49
The offset tag is used to define the corners and edges of a frame graphic, without having to individually specify each rectangle for each edge/corner/middle. It's much quicker and does not require you to know the exact dimensions of the frame graphic.

These two definitions are the same given that the fieldfocus.png is 224x211.



<framedef name="fieldfocus">
<bitmap file="graphics/frames/fieldfocus.png" />
<offset>12,12,12,12</offset>
</framedef>




<framedef name="fieldfocus">
<bitmap file="graphics/frames/fieldfocus.png" />
<topleft rect="0,0,12,12" />
<top rect="12,0,200,12" />
<topright rect="212,0,12,12" />
<left rect="0,12,12,187" />
<middle rect="12,12,200,187" />
<right rect="212,12,12,187" />
<bottomleft rect="0,199,12,12" />
<bottom rect="12,199,200,12" />
<bottomright rect="212,199,12,12" />
</framedef>


At this point, the insideoffset is purely for specifying the right and bottom offsets for the window resizing functionality. Since some frames have transparent space along the right and bottom side, this allow you to specify an offset other than 0 to determine where to show the window resize cursors and allow dragging of window edges.

Regards,
JPG

Blacky
August 11th, 2013, 11:00
Thanks, much more clear.