<base_name>_<ibox_position>.<image_filetype>
This documentation introduces the basic skinning tools used by the P.I.S.D. Layers. Applications and games are free to use these tools as they wish. Therefore they may not implement all the functionality detailed here. There are specific notes at the end of this document on some individual applications using the P.I.S.D. skinning system.
An image box is a rectangular area of specified size made by combining one or more images. An image box uses a set of image files with matching file names. Image Boxes load a set of 1,3 or 9 images which it then tiles or re sizes to produce the box of the requested size. The file names match the following pattern:
<base_name>_<ibox_position>.<image_filetype>
The base name can be anything you like and is used to identify the members of the image box. The image box position identifies where in the box the image belongs. This is dependant on the number of images that make up the set. The system automatically works out which kind of image box to use by the files it finds. Therefore it is important to make sure you have all the images that make up the image box otherwise it will not load. Image file type can be any supported image format such as JPG, PNG. It is recommended to use PNG rather than JPG as a JPG image slightly distorts the image and can create strange effects when the image box is drawn.
This is the best image box to use as it will re size in both directions with little or no distortion. The files required for a 9-way image box are:
<base_name>_top_left.png <base_name>_top_mid.png <base_name>_top_right.png <base_name>_mid_left.png <base_name>_mid_mid.png <base_name>_mid_right.png <base_name>_bottom_left.png <base_name>_bottom_mid.png <base_name>_bottom_right.png
<base_name>_left.png <base_name>_mid.png <base_name>_right.png
<base_name>_top.png <base_name>_mid.png <base_name>_bottom.png
In the case of buttons you can specify an image box for each state the button can have. The following image boxes are required to draw this object:
The button is in its natural idle state.
The button is pressed by either the mouse or keyboard shortcut.
Used for up and down states if both fail to load.
The following image boxes are optional:
The button is not functional.
The button is not pressed and in its active state.
The button is pressed by either the mouse or keyboard shortcut and in its active state.
The button is not functional and in its active state.
Mouse is hovering over button and in its active state.
Button is highlighted.
Mouse is hovering over button.
If provided, the button alternates with this image box at regular intervals.
If provided, the button uses this image box when it is being dragged. If this is not supplied a semi-transparent image of the current button state is used.
For example, if you want to create a set of images for a button when the mouse if hovering over it using a 9-way image box, you need the following images:
<base_name>_over_top_left.png <base_name>_over_top_mid.png <base_name>_over_top_right.png <base_name>_over_mid_left.png <base_name>_over_mid_mid.png <base_name>_over_mid_right.png <base_name>_over_bottom_left.png <base_name>_over_bottom_mid.png <base_name>_over_bottom_right.png
You can then repeat the above replacing "over" with "down" to create the images to show a button in the down state (i.e. pushed by the user clicking on it).
The skinning system is built around style sets. Each one details a look that can be applied to any on screen object. They are simple text files allowing you to link to images, set spacing and a selection of other visible settings.
Style sets can work in two different ways, graphical or API mode.
In API mode, the object defined by the style set will use API drawing routines to render the object. These are such tools as draw_line() and draw_rect(). This creates a very fast but rather simple, dated look. You can use the style set to control the colours used to draw the object and a few simple settings.
In graphical mode, image box(s) are used to render the object. This is achieved by setting the "image_filename" field in the style. This is used as the <base_name> field when loading in image boxes. When in graphical mode the API drawing information is not used and can be ignored.
Here are the supported settings for a style set:
The name of this style set. It can be used by the application to locate this style set. It does not have to be unique, however if the application searches for the name and there are two identical entries it may not find the right style set.
The base name of the image box(s) used to draw the object. If this is valid the object is drawn in graphical mode, otherwise API mode is used.
The path where the image box(s) are located. See Disk Paths for an explanation of path entries.
TDB
The foreground colour of the object. In most cases this is the colour of text on the object. See Colour Formats for explanation of valid colour entries.
The background colour of the object. See Colour Formats for explanation of valid colour entries.
Only used when object is drawn in API mode
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
The width of the side scrollbar if present.
Only used by grid objects
The percentage by which each alternate grid row is darkened. I negative percentage can be used to lighten the alternate rows. The ssef_grid_two_tone flag must be set for this value to be used.
Only used by grid objects
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
Set to 1 for a fixed top row that does not scroll, otherwise set it to 0. This can be very useful for column headings so they are always visible.
Only used by grid objects
Set to 1 to make the grid darken every alternate row by grid_two_tone_value percent, otherwise set it to 0.
Only used by grid objects
Set to 1 to make the grid draw line by line, otherwise set it to 0. The grid background is calculated line by line.
Only used by grid objects
Set to 1 to make the grid draw cell by cell, otherwise set it to 0. The grid background is calculated cell by cell.
Only used by grid objects
Set to 1 to make the grid scroll down a row at a time. Set to 0 to make the grid scroll one pixel at a time.
Only used by grid objects
Set to 1 to stop the grid automatically creating a scrollbar when the number of rows exceeds the space to draw. Set to 0 to make the grid dynamically create a scrollbar as needed.
Only used by grid objects
Set to 1 to stop the grid drawing unused rows at the end of the data. Set to 0 to make the grid draw blank lines after the data until the end of the grid.
Only used by grid objects
Set to 1 to make stop scrollbar being shortened below the fixed top row, otherwise set it to 0.
Only used by grid objects
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
TDB
In order to define a graphical button using a style set you first need to create the required image box sets for each button state you want. In this example we will create a button using 3-way Horizontal image boxes for the up, down and over button states. We will use a base name of "my_button", but this could be anything we like that identifies this buttons images. So that means we need the following images:
my_button_up_left.png my_button_up_mid.png my_button_up_right.png my_button_down_left.png my_button_down_mid.png my_button_down_right.png my_button_over_left.png my_button_over_mid.png my_button_over_right.png
Assuming the above images are in a sub folder named "ibox_images", you would then make the following changes to the style set to tell it which images to use:
image_filename
my_button
image_path
$HERE/ibox_images
Now when this style set is used to skin a button, the images you created above will be used to draw that button.
Grids are often used to display tables of data. It is often hard to read a grid if the background is one uniform tone or colour. There are a number of tools to change the visual appearance of grids to make them easier to see.
ssef_grid_type_cells and ssef_grid_type_lines can make the lines stand out by changing the way the grid draws its background. This is not suitable if you want to round the corners of your grid as it would round each cell or each line respectively.
You can use ssef_grid_two_tone and grid_two_tone_value to darken each alternate line. If you wish to lighten the line you can supply a negative two tone value. This easily adds a subtle line effect that can help the visual impact of a grid.
The last option is only available if it is supported by the application you are skinning. It is possible to supply separate style sets for alternate rows. So all the even numbered rows use one style set and the odd numbered rows use another style set. This gives you the most graphical control, however not all applications support this method.
All there methods above work in conjunction with each other. This allows you to combine the effects to create the desired look..
There are three supported colour formats, RGB, HSL and CMYK. RGB is how the graphics hardware works and therefore is used internally by the system. This means both HSL and CMYK need to be converted which can introduce slight errors. This means you should consider using the RGB format in preference to HSL and CMYK.
The CMYK format is designed around printer hardware, specifying the amount of each coloured ink needed to create the desired colour. This means the RGB and CMYK systems are very different in how they combine colours. For example all colours combined with the CMYK system creates black, but all colours combined with the RGB system creates white. Conversion between these different systems is only approximate as a result, so any colour specified as CMYK is not going to be very accurate.
The skinning system uses a full 8-bit alpha channel which is pre-pended to the three supported colour formats. So RGB becomes ARGB, where the A indicates the alpha value. An alpha channel of zero means the colour is transparent, with an alpha channel of the maximum range being solid.
In order to make things simpler the system understands four different number ranges. They are all the same internally so feel free to use whichever number range you feel most comfortable using.
This specifies a colour using RGB format in hexadecimal where the alpha is solid, red is 0x01, green is 0x02 and blue is 0x03.
NOTE: This is a special case and is included for compatibility with HTML colour specifications.
This specifies a colour using ARGB format in hexadecimal where the alpha is 0xFF, red is 0x01, green is 0x02 and blue is 0x03.
This specifies a colour using AHSL format in hexadecimal where the alpha is 0xFF, hue is 0x01, saturation is 0x02 and level is 0x03.
This specifies a colour using ACMYK format in hexadecimal where the alpha is 0xFF, cyan is 0x01, magenta is 0x02, yellow is 0x03 and black is 0x04.
This specifies a colour using ARGB format in percent where the alpha is 100%, red is 1%, green is 2% and blue is 3%.
This specifies a colour using AHSL format in percent where the alpha is 100%, hue is 1%, saturation is 2% and level is 3%.
This specifies a colour using ACMYK format in percent where the alpha is 100%, cyan is 1%, magenta is 2%, yellow is 3% and black is 4%.
This specifies a colour using ARGB format in the range 0-255 where the alpha is 255, red is 1, green is 2 and blue is 3.
This specifies a colour using AHSL format in the range 0-255 where the alpha is 255, hue is 1, saturation is 2 and level is 3.
This specifies a colour using ACMYK format in the range 0-255 where the alpha is 255, cyan is 1, magenta is 2, yellow is 3 and black is 4.
This specifies a colour using ARGB format in the range 0.0-1.0 where the alpha is 1.0, red is 0.1, green is 0.2 and blue is 0.3.
This specifies a colour using AHSL format in the range 0.0-1.0 where the alpha is 1.0, hue is 0.1, saturation is 0.2 and level is 0.3.
This specifies a colour using ACMYK format in the range 0.0-1.0 where the alpha is 1.0, cyan is 0.1, magenta is 0.2, yellow is 0.3 and black is 0.4.
The core design of the P.I.S.D. Layers aims to remove platform specific knowledge. One of the areas where this is most obvious is disk paths. Each OS has its own way to identify and handle disk drives and devices. For example Microsoft Windows uses driver letters (c:\, d:\, etc) which are not understood on Apple Mac or Linux. The P.I.S.D. Layers handle this by creating a set of useful locations the core of which are relative to the application location. This allows paths to have a sensible meaning on all the platforms supported by the P.I.S.D. Layers. That way a path saved on one platform has a good chance of working on another.
The locations can be considered equivalent to drive specifications. You can append sub-folders using the / character. Do not use a the windows \ character as it is not supported. So to set the path to an installed data file in the sub folder "my-path" you should use "$APPDATA/my-path".
Here are the known folder locations:
location of the running program
system specific location of shared, installed, read only data (set to $APP/data)
location of user specific applications that can be installed by the current user. (if folder not found it is set to $APP)
Windows: CSIDL_APPDATA\<app_name>
98/XP/2k = C:\Documents and Settings\<username>\Application Data\<app_name>
Vista/7 = C:\Users\<username>\AppData\Roaming\<app_name>
Mac: kCurrentUserFolderType/.<app_name>/bin
/Users/<username>/.<app_name>/bin
Linux: ~/.<app_name>/bin
User specific location of installed read/write data that can be installed by the current user. Data in this folder should not require the user to access it from outside the application. (if folder not found it is set to $APP/data)
Windows: CSIDL_APPDATA\<app_name>
98/XP/2k = C:\Documents and Settings\<username>\Application Data\<app_name>
Vista/7 = C:\Users\<username>\AppData\Roaming\<app_name>
Mac: kCurrentUserFolderType/.<app_name>/data
/Users/<username>/.<app_name>/data
Linux: ~/.<app_name>/data
system specific location of user customizable data/preferences that can be installed by the current user. Data in this folder may require the user to access it outside the application using 3rd party tools such as a text editor. (if folder not found it is set to $APP/data)
Windows: CSIDL_PERSONAL\<app_name>
98/XP/2k = C:\Documents and Settings\<username>\My Documents\<app_name>
Vista/7 = C:\Documents and Settings\<username>\My Documents\<app_name>
Mac: kDocumentsFolderType/<app_name>/custdata
/Users/<username>/Documents/<app_name>
Linux: ~/.<app_name>/custdata (Symlinked to ~/Documents/<app_name>)
location of system wide applications and can only be installed with root access (if folder not found it is set to $APP)
Windows: CSIDL_PROGRAM_FILES\<app_name>
98/XP/2k = C:\Program Files\<app_name>
Vista/7 = C:\Program Files\<app_name>
Mac: /Applications/<app_name>
Linux: /opt/<app_name>/bin
system specific location of shared, installed, read/write data. This folder requires root access to install, but once created any user can change it. Data in this folder should not require the user to access it from outside the application. (if folder not found it is set to $APP/data)
Windows: CSIDL_COMMON_APPDATA\<app_name>
98/XP/2k = C:\Documents and Settings\All Users\Application Data\<app_name>
Vista/7 = C:\ProgramData\<app_name>
Mac: kSharedUserDataFolderType/<app_name>/data
/Users/Shared/<app_name>/data
Linux: /opt/<app_name>/data
system specific location of shared, customizable, data/preferences (read/write) This folder requires root access to install, but once created any user can change it. Data in this folder may require the user to access it outside the application using 3rd partry tools such as a text editor. (if folder not found it is set to $APP/data)
Windows: CSIDL_COMMON_DOCUMENTS\<app_name>
98/XP/2k = C:\Documents and Settings\All Users\Documents\<app_name>
Vista/7 = C:\Documents and Settings\All Users\Documents\<app_name>
Mac: kSharedUserDataFolderType/<app_name>/custdata
/Users/Shared/<app_name>/custdata
Linux: /opt/<app_name>/custdata
location of data for running app
Set to the first found of these locations in this order:
$USERDATA
$SYSDATA
$APPDATA
$APP
NOTE: If you use this with the create_if_not_found set the system will create the first folder it can in the given order.
system specific location of temp data (if not folder not found it is set to $APP/temp)
Windows: CSIDL_PERSONAL\<app_name>\temp
98/XP/2k = C:\Documents and Settings\<username>\My Documents\<app_name>\temp
Vista/7 = C:\Documents and Settings\<username>\My Documents\<app_name>\temp
Mac: kTemporaryFolderType/<app_name>
/private/var/tmp/*/<app_name>
Linux: ~/tmp/<app_name> or /tmp/<app_name>
root folder of drive/device x (where x is the drive/device number)
location of font data (normally $APPDATA/fonts)
location of font data (normally $APPDATA/fonts)
situation specific as it is passed in by the application. In the case of style sets it is the location of the current style set file.
Depreciated - Use $APP
Depreciated - Use $APPDATA
The Out Of The Park Baseball skin does not allow the screen layout to be changed. This is deliberate due to the complexity of some of the screens. That said, there is the ability to adjust border sizes and alignment information. The style sets can be found in data/skins/ootp classic/style_sets.
Out Of The Park Baseball currently uses the "two tone" settings for grids (See Grid Style Set section) which darkens every alternate row. It does not support the alternate style set system.
Once you have changed the skinning information you will need to delete the skin cache file data/skins/ootp classic/skin.bin. When you restart the game it will take quiet a bit longer to start as it reads all the skinning information and rebuilds the skin cache. On a Mac it can take a really long time as opening files can be rather slow. Or if you prefer you can select "rebuild skin" option from the game menu.
There are lots more settings and bits you can change. Its is very easy to mess things up so make sure you copy an existing skin and don't change the supplied one so you can always get back in.
If you get stuck then please feel free to email someone@pisd.co.uk for help.