DICE PACKS BUNDLE
  1. #1
    GMBazUK's Avatar
    Join Date
    May 2006
    Location
    Gloucestershire, England
    Posts
    148

    Referencing an image to a genericcontrol

    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.

  2. #2
    Foen's Avatar
    Join Date
    Jan 2007
    Location
    Suffolk, England
    Posts
    2,007
    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:

    Code:
      <framedef name="myimage">
        <bitmap file="frames/myimage.png" />
        <middle rect="0,0,100,200" />
      </framedef>
    The your genericcontrol would look a bit like this:

    Code:
      <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

  3. #3
    GMBazUK's Avatar
    Join Date
    May 2006
    Location
    Gloucestershire, England
    Posts
    148
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
STAR TREK 2d20

Log in

Log in