View Full Version : Rect coordinates?

February 15th, 2005, 16:01
What are the following refering to?

<framedef name="mini_spellsheet">
<bitmap file="rulesets\d20 Modern\frames\mini_spellsheet.png" />
<topleft rect="0,0,9,24" />
<top rect="9,0,149,24" />
<topright rect="158,0,11,24" />
<left rect="0,24,9,120" />
<middle rect="9,24,149,120" />
<right rect="158,24,11,120" />
<bottomleft rect="0,144,9,23" />
<bottom rect="9,144,149,23" />
<bottomright rect="158,144,11,23" />

February 15th, 2005, 16:17
They are portions of the graphics drawn in the corresponding places. And why this has been defined in such a cumbersome manner is because of enabling resizing windows. The corner parts are always drawn in the corners, but the top, left, right, and bottom parts are cycled to fill the required dimension. Therefore, in creating new graphics to some window, it should be kept in mind that those parts should cycle gracefully and also interface the corner bits in a suitable manner. middle means the bulk of the window texture.

February 15th, 2005, 16:24
am I right in thinking all co-ordinates are given in X, Y, X-length, Y-length. Where X,Y gives you the top left corner and by adding the lengths you find the bottom right.

If so how does that code relate to

<windowclass name="charsheet_minispellentry">
<frame name="mini_spellsheetentry" />
<datasource name="spell" />
<defaultsize width="149" height="20" />
<stringcontrol name="name">
<bounds rect="0,3,145,15" />
<font name="smallcontrol" />
<static />
<numbercontrol name="prepared">
<bounds rect="120,1,26,18" />
<font name="smallcontrol" />

<windowclass name="mini_spellsheet">
<frame name="mini_spellsheet" />
<datasource name="charsheet" />
<dynamic resize="vertical" />
<defaultsize width="169" height="200" />
<nodelete />
<playercontrol />
<windowlist class="charsheet_minispellentry">
<bounds rect="9,24,-11,-23" />
<allowcreate />
<allowdelete />
<nestdata />
<b-ounds rect="6,6,200,200" />
<sort fields="name,level" />
<filter field="prepared" value="!0" />

The negative values are confusing me somewhat.

February 15th, 2005, 18:07
There is a lot of stuff there and before answering I want to ask if there is anything specific besides the negative coordinates you are interested in. The negative coordinates are a way to start counting pixels from right and bottom and there are some limitations to their use. They are generally usable in sub entries within windows. Also a number of coordinates quoted above are relative coordinates for inserting graphics within the window,