Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Expand
titleClick here to show Table of Contents
Table of Contents

Introduction

Rulesets and extensions contain many definitions for assets that are used to implement the user interface and logic. These include graphic assets, such as icons and fonts, as well as user interface assets, such as window classes and templates. All assets are reference by their name attribute for use within the ruleset. Also, any file references are considered to be relative to the ruleset or extension folder/file where the asset is defined.

This topic will cover the individual asset types that can be defined within a ruleset.

Icons

Icon assets define simple images, usually used to represent a symbol or a user interface element such as a button. Icon images are usually relatively small, and will be scaled down to fit the size of the interface element they are used within.

Several image file formats are supported, but the recommended choices are PNG and JPG. These formats are widely available and create reasonably small file sizes. PNG images also have good transparency support and do not suffer from image degradation.

Example

Code Block
languagexml
<icon name="button_maps">icons/button_maps.png</icon>

Strings

String assets define text strings that can be referenced by windows, controls and scripts within the ruleset. By using string assets instead of defining the strings directly, the ruleset can more easily be modified by extensions to support other languages.

Example

Code Block
languagexml
<string name="sidebar_tooltip_ct">Combat Tracker</string>

Frames

Frames assets are graphical elements that draw a rectangular background image. They are typically used as window and control background graphics that are capable of adjusting to the size of the element.

...

The following two examples illustrates the definition of a frame using individual section definitions as well as the offset method.

Examples

Code Block
languagexml
<framedef name="minisheet">
  <bitmap file="frames/minisheet.png" />
  <topleft rect="0,0,15,15" />
  <top rect="15,0,250,15" />
  <topright rect="265,0,16,15" />
  <left rect="0,15,15,249" />
  <middle rect="15,15,250,249" />
  <right rect="265,15,16,249" />
  <bottomleft rect="0,264,15,16" />
  <bottom rect="15,264,250,16" />
  <bottomright rect="265,264,16,16" />
</framedef>

<framedef name="minisheet">
  <bitmap file="frames/minisheet.png" />
  <offset>15,15,16,16</offset>
</framedef>

Fonts

Font assets determine the appearance of text within the user interface. Fonts have three properties, the font file to use, the default color to use for this font, and an optional shadow tag to define background shadows. Font colors can be overridden in most controls that use font assets.

...

Fantasy Grounds Classic still supports the legacy .FGF format. The FGF font files can be creates by using the Font Generator utility.

Examples

Code Block
languagexml
<font name="windowtitle">
  <ttf file="graphics/fonts/AlegreyaSansSC-Bold.ttf" name="Alegreya Sans SC" size="26" />
  <color>#000000</color>
  <shadow offset="1,1" color="#808080" />
</font>

<font name="chatfont">
  <fgffile>fonts/regular.fgf</fgffile>
  <color>#000000</color>
</font>

Dice

Dice assets are used by the system for handling the 3D dice on the desktop, for use die database values and window controls, and for generating die rolls based on the ruleset logic.

...

Percentile dice in Fantasy Grounds have a slightly different convention than most RPGs. The d100 die and the d10 are always added together. So, a 00 on the d100 die, and a 10 on the d10 die, will return a value of 10 (00+10); and a 90 on the d100 die and a 10 on the d10 die, will return a value of 100 (90+10). While this convention is slightly different than the most most way to interpret percentile dice, it still correctly returns a range of 1-100.

Examples

Code Block
languagexml
<die name="d6">
  <icon>d6icon</icon>
  <position>310,-88</position>
</die>

<customdie name="d3">
  <model>d6</model>
  <menuicon>customdice</menuicon>
  <script>
    function onValue(result)
      return math.ceil(result/2);
    end
  </script>
</customdie>

Portraits and Portrait Sets

Player clients can select portrait images for any of their player character (PC) identities. These portrait images are then used to automatically generate icon assets based on any portrait set definitions in the ruleset. An icon generated in this way will be automatically updated when the PC identity portrait is changed. These icons can be used as usual in any context that icon assets can normally be used.

...

If the createtoken tag is added to a portrait set definition, a token asset with the same name as the icon will be defined.

Examples

Code Block
languagexml
<portraitset name="charlist">
  <base>charlist_base</base>
  <mask>charlist_mask</mask>
</portraitset>

<portraitset name="chat">
  <base>portraitchat_base</base>
  <mask>portraitchat_mask</mask>
  <createtoken />
</portraitset>

Tokens

Tokens are not specifically defined as assets within Fantasy Grounds, but are added automatically when graphic files are placed in the correct file location. Within rulesets, any graphic files within a "tokens" subfolder will be automatically added to the campaign using the ruleset. Any tokens added from a ruleset will have a token name of "ruleset/[ruleset_name]/[token_path]".

Window Classes

Window classes are asset definitions that define the way that the user interface works within a ruleset. The full breakdown of the window class asset is given in the Rulesets - Interface topic.

Templates

Templates are asset definitions that can be used to extend or centralize window control definitions for use within window classes. The full breakdown of the template asset is given in the Rulesets - Templates topic.