How to Create a HTML Asset

From TrainzOnline
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
 
'''HTML assets''' in TANE consist of several parts:-
 
'''HTML assets''' in TANE consist of several parts:-
 
*a config.txt file which is mandatory
 
*a config.txt file which is mandatory
*(optionally) one or more HTML formatted text files of type .htm, .html
 
 
*one or more graphic files of type .jpg, .tga, .png, .bmp. One of these must be the asset thumbnail.
 
*one or more graphic files of type .jpg, .tga, .png, .bmp. One of these must be the asset thumbnail.
 +
*(optionally) one or more HTML formatted text files of type .htm, .html
 
*(optionally) one or more sound files of type .wav
 
*(optionally) one or more sound files of type .wav
 
*(optionally) one or more folders
 
*(optionally) one or more folders
Line 44: Line 44:
 
*The '''description''' provides more detail than the '''username'''.
 
*The '''description''' provides more detail than the '''username'''.
 
*The '''thumbnails''' is the ''preview'' image of the asset shown by the '''Content Manager''' program and the Web version of the ''DLS''. Information on thumbnails can be found at '''[[Thumbnails]]'''
 
*The '''thumbnails''' is the ''preview'' image of the asset shown by the '''Content Manager''' program and the Web version of the ''DLS''. Information on thumbnails can be found at '''[[Thumbnails]]'''
 +
 +
==='''Graphic Files'''===
 +
 +
There are some differences in the graphic files supported between '''TANE HTML''' and '''Web HTML'''.
 +
 +
<table border="1">
 +
<tr valign="top">
 +
<td>'''Graphic<br>Format'''</td>
 +
<td>'''TANE'''</td>
 +
<td>'''Web'''</td>
 +
<td>'''Main Points'''</td>
 +
<td>'''Recommendation'''</td>
 +
</tr>
 +
<tr valign="top">
 +
<td>'''GIF'''</td>
 +
<td>'''not supported'''</td>
 +
<td>supported</td>
 +
<td></td>
 +
<td>'''Do not use'''</td>
 +
</tr>
 +
<tr valign="top">
 +
<td>'''JPG'''</td>
 +
<td>supported</td>
 +
<td>supported</td>
 +
<td>
 +
*lossy compression<br>
 +
*no transparency</td>
 +
<td>'''Avoid if possible'''</td>
 +
</tr>
 +
<tr valign="top">
 +
<td>'''BMP'''</td>
 +
<td>supported</td>
 +
<td>supported</td>
 +
<td>
 +
*lossless but no compression<br>
 +
*limited transparency</td>
 +
<td>'''Avoid'''</td>
 +
</tr>
 +
<tr valign="top">
 +
<td>'''PNG'''</td>
 +
<td>supported</td>
 +
<td>supported</td>
 +
<td>
 +
*lossless compression<br>
 +
*transparency</td>
 +
<td>Use if compatibility with older Trainz versions is NOT needed</td>
 +
</tr>
 +
<tr valign="top">
 +
<td>'''TGA'''</td>
 +
<td>supported</td>
 +
<td>not supported</td>
 +
<td>
 +
*lossless with optional compression<br>
 +
*optional transparency</td>
 +
<td>Use if compatibility with older Trainz versions is needed</td>
 +
</tr>
 +
</table>

Revision as of 17:56, 25 May 2018

HTML assets in TANE consist of several parts:-

  • a config.txt file which is mandatory
  • one or more graphic files of type .jpg, .tga, .png, .bmp. One of these must be the asset thumbnail.
  • (optionally) one or more HTML formatted text files of type .htm, .html
  • (optionally) one or more sound files of type .wav
  • (optionally) one or more folders

Config.txt

A standard config.txt file that must include the following tags:-

  • kind set to "html-asset"
  • username set to the page title
  • kuid a unique ID number
  • category-class set to "YH"
  • thumbnails a 240 by 180 pixel image

While not mandatory, the following tag is useful:-

  • category-class set to "YH"

An example (the order of the "tags" is not important):-

kuid                                    <kuid:45176:100207>
username                                "TGR Fingal Line 1955 - Mixed Goods Sessions HTML"
trainz-build                            4.5
kind                                    "html-asset"
description                             "HTML data for TGR Fingal Line 1955 Conara Mixed Goods Sessions - all versions"
category-class                          "YH"
thumbnails
{
  0
  {
    image                               "thumbnail.jpg"
    width                               240
    height                              180
  }
}
  • The <kuid> is unique to every asset which is why it is not advisable to select your own. This will be automatically generated by the Content Manager program when a new asset is created.
  • The username is your name for the asset and the name that other users will see. It is advisable to make it compact and meaningful.
  • The trainz-build identifies the minimum Trainz version for this asset. A list of asset trainz-build numbers and their corresponding Trainz versions can be found at "Trainz-build"_number
  • The kind identifies the type of asset and the types of files that Trainz will expect to find in the asset. It also tells Trainz how to render and error check the asset. A list of asset kinds can be found at KIND Hierarchy
  • The category-class identifies the intent of the asset and is important in classifying it for filtering and searching. A list of category classes can be found at Category-class
  • The description provides more detail than the username.
  • The thumbnails is the preview image of the asset shown by the Content Manager program and the Web version of the DLS. Information on thumbnails can be found at Thumbnails

Graphic Files

There are some differences in the graphic files supported between TANE HTML and Web HTML.

Graphic
Format
TANE Web Main Points Recommendation
GIF not supported supported Do not use
JPG supported supported
  • lossy compression
  • no transparency
Avoid if possible
BMP supported supported
  • lossless but no compression
  • limited transparency
Avoid
PNG supported supported
  • lossless compression
  • transparency
Use if compatibility with older Trainz versions is NOT needed
TGA supported not supported
  • lossless with optional compression
  • optional transparency
Use if compatibility with older Trainz versions is needed
Personal tools