PDA

View Full Version : Referencing an image to a genericcontrol



GMBazUK
April 8th, 2008, 19:20
Noob alert!

Im trying to add an "image" of a figure to the armour sheet/section of the character sheet Im building.
Ive looked at how the acicon was added to the combat sheet of the D20 ruleset, but from what I can tell, it was referenced to the output field which inturn was referenced to the generic control.

I want to reference the image to the generic control, and then reference my numberfields (output fields) etc to the image. I have added the image to the graphicframes.xml, and given it a frame definition.
Its pretty clear Im a total noob at this, but would appreciate any assistance.

Hope this is clear enough. Thanks in advance Baz.

Foen
April 9th, 2008, 06:09
The genericcontrol has a <frame> element, which should be set to the new image. For example, if your image was 100x200 and called frames\myimage.png, and you had a line in graphic_frames.xml:



<framedef name="myimage">
<bitmap file="frames/myimage.png" />
<middle rect="0,0,100,200" />
</framedef>


The your genericcontrol would look a bit like this:



<genericcontrol>
<anchored>
... some anchoring ...
<size>
<width>100</width>
<height>200</height>
</size>
</anchored>
<frame>myimage</frame>
</genericcontrol>


The frame definition for a stright image (without resizing or tiling) just needs a 'middle' section which starts at the top left (0,0) and has the width and height of the image.

The genericcontrol then has the same size as the image.

Hope that helps

Stuart

GMBazUK
April 9th, 2008, 09:12
Thanks Foen,
It was the whole... adding another genericcontrol thing that threw me, plus the fact I didnt have to reference it to the first "sheetgroup" genericcontrol.

Works like a charm.:)