Spyke
September 17th, 2008, 12:42
The extension functionality does look very, very useful. I'm going to post a quick example here of one way to create a skin using an extension. What's the best way of doing this? What are the potential pitfalls? Is there a need for a common way of doing this to make it easier to share skins between rulesets?
A simple skin
This skin simply changes the look of the chatbox and the icon used for the story button, but the techniques can be extended to cover all frames, icons and fonts.
1. Create a new folder in the extensions folder in your Fantasy Grounds application folder. I've called mine 'skin'.
2. Create a file called extensions.xml in your skin folder containing the following code:
<?xml version="1.0" encoding="iso-8859-1"?>
<root version="2.0">
<properties>
<name>Skin</name>
<version>1</version>
<author>Graham Brand</author>
<description>A simple demonstration extension that changes the look of the default ruleset</description>
<ruleset>
<name>d20</name>
<minrelease>12</minrelease>
</ruleset>
</properties>
<base>
<!-- Replace the chat box frame -->
<framedef name="chatbox">
<bitmap file="frames/chatbox.png" />
<topleft rect="0,0,150,150" />
<top rect="150,0,200,150" />
<topright rect="350,0,179,150" />
<left rect="0,150,150,200" />
<middle rect="150,150,200,200" />
<right rect="350,150,179,200" />
<bottomleft rect="0,350,150,180" />
<bottom rect="150,350,200,180" />
<bottomright rect="350,350,179,180" />
</framedef>
<!-- Replace the story book icon -->
<icon name="button_book" file="icons/button_book.png" />
<icon name="button_book_down" file="icons/button_book_down.png" />
</base>
</root>
3. Create folders called 'frames' and 'icons' under your skin folder, and put the new chatbox.png in the frames folder and the book button pngs in the icons folder.
4. Start FG II with the d20 ruleset and tick to load the skin extension. Your d20 campaign should load with the new graphics.
5. Once you're happy with your new look, create a zip file by selecting extensions.xml and the sub-folders. Rename it with the .ext extension and put it in the top-level extensions folder. This can then be distributed without the underlying folders.
For more extensive changes, you would break the graphics out into separate include files. See the way base.xml and graphics.xml handle this in the default d20 ruleset.
I've attached the sample files below.
Spyke
A simple skin
This skin simply changes the look of the chatbox and the icon used for the story button, but the techniques can be extended to cover all frames, icons and fonts.
1. Create a new folder in the extensions folder in your Fantasy Grounds application folder. I've called mine 'skin'.
2. Create a file called extensions.xml in your skin folder containing the following code:
<?xml version="1.0" encoding="iso-8859-1"?>
<root version="2.0">
<properties>
<name>Skin</name>
<version>1</version>
<author>Graham Brand</author>
<description>A simple demonstration extension that changes the look of the default ruleset</description>
<ruleset>
<name>d20</name>
<minrelease>12</minrelease>
</ruleset>
</properties>
<base>
<!-- Replace the chat box frame -->
<framedef name="chatbox">
<bitmap file="frames/chatbox.png" />
<topleft rect="0,0,150,150" />
<top rect="150,0,200,150" />
<topright rect="350,0,179,150" />
<left rect="0,150,150,200" />
<middle rect="150,150,200,200" />
<right rect="350,150,179,200" />
<bottomleft rect="0,350,150,180" />
<bottom rect="150,350,200,180" />
<bottomright rect="350,350,179,180" />
</framedef>
<!-- Replace the story book icon -->
<icon name="button_book" file="icons/button_book.png" />
<icon name="button_book_down" file="icons/button_book_down.png" />
</base>
</root>
3. Create folders called 'frames' and 'icons' under your skin folder, and put the new chatbox.png in the frames folder and the book button pngs in the icons folder.
4. Start FG II with the d20 ruleset and tick to load the skin extension. Your d20 campaign should load with the new graphics.
5. Once you're happy with your new look, create a zip file by selecting extensions.xml and the sub-folders. Rename it with the .ext extension and put it in the top-level extensions folder. This can then be distributed without the underlying folders.
For more extensive changes, you would break the graphics out into separate include files. See the way base.xml and graphics.xml handle this in the default d20 ruleset.
I've attached the sample files below.
Spyke