Difference between revisions of "Label Element (Data)"

From HLKitWiki
Jump to: navigation, search
(New page: {{context|Kit Reference|Data File Reference|Portal Element (Data)}} ==The "label" Element== When you want to display text to the user, it's usually easiest to utilize a label portal, whi...)
 
 
Line 5: Line 5:
 
When you want to display text to the user, it's usually easiest to utilize a label portal, which is specified through the use of a "label" element. The complete list of attributes for this element is below.
 
When you want to display text to the user, it's usually easiest to utilize a label portal, which is specified through the use of a "label" element. The complete list of attributes for this element is below.
  
{{important}}Only one mechanism for specifying the label contents may be employed within a given label portal. That means you may use '''either''' the "text" attribute, the "field" attribute, '''OR''' the "labeltext" script to define the contents. Use of multiple mechanisms will result in a compilation error.
+
{{important}}Only one mechanism for specifying the label contents may be employed within a given label portal. That means you may use '''either''' the "text" attribute, the "field" attribute, the "labeltext" script '''OR''' the "dossier" attribute to define the contents. Use of multiple mechanisms will result in a compilation error.
  
 
:{| class="infotable"
 
:{| class="infotable"
Line 22: Line 22:
 
|istitle
 
|istitle
 
|(Optional) Boolean – Indicates whether the label text is being used as a title, which entails special automatic sizing behaviors for proper handling. Default: "no".
 
|(Optional) Boolean – Indicates whether the label text is being used as a title, which entails special automatic sizing behaviors for proper handling. Default: "no".
 +
|-
 +
|dossier
 +
|(Optional) Id – If specified, must be the unique id of a text dossier that supports the "print" style. The text for that dossier is generated and used as the text for the label. Default: Empty.
 +
|-
 +
|dossierspecial
 +
|(Optional) Integer – This value is passed into the dossier script as the "@special" special symbol. This allows you to customize the statblock based on where it's called from. Default: "0".
 
|-
 
|-
 
|}
 
|}

Latest revision as of 22:21, 19 December 2013

Context: HL KitKit Reference … Data File Reference … Portal Element (Data) 

The "label" Element

When you want to display text to the user, it's usually easiest to utilize a label portal, which is specified through the use of a "label" element. The complete list of attributes for this element is below.

IMPORTANT! Only one mechanism for specifying the label contents may be employed within a given label portal. That means you may use either the "text" attribute, the "field" attribute, the "labeltext" script OR the "dossier" attribute to define the contents. Use of multiple mechanisms will result in a compilation error.

text (Optional) Text – Specifies a string of literal text to be displayed within the label. Default: Empty.
field (Optional) Id – Specifies the unique id of the field whose value is to be displayed within the label. The field must exist within the pick/thing associated with the containing template. If this portal is not defined within a template, a field-based label is not allowed. Default: Empty.
ismultiline (Optional) Boolean – Indicates whether the label text is to be treated as multi-line or merely a single line of output. Default: "no".
scrollable (Optional) Boolean – Indicates whether the label text is large enough to require a vertical scroller be included that allows the user to scroll through the contents. Default: "no".
istitle (Optional) Boolean – Indicates whether the label text is being used as a title, which entails special automatic sizing behaviors for proper handling. Default: "no".
dossier (Optional) Id – If specified, must be the unique id of a text dossier that supports the "print" style. The text for that dossier is generated and used as the text for the label. Default: Empty.
dossierspecial (Optional) Integer – This value is passed into the dossier script as the "@special" special symbol. This allows you to customize the statblock based on where it's called from. Default: "0".

The "label" element also possesses child elements that define additional behaviors of the portal. The list of these child elements is below and must appear in the order shown. Click on the link to access the details for each element.

labeltext An optional "labeltext" element may appear as defined by the given link. This element defines a Label Script that is used for synthesizing the text to be output.

The "labeltext" Element

The "labeltext" element defines a Label Script for the portal. The complete list of attributes for this element is below.

PCDATA Script – Specifies the code comprising the Label script.

Example

The following example demonstrates what a label portal might look like. All default values are assumed for optional attributes.

<portal id="name" style="lblNormal" showinvalid="yes">
  <label field="name"/>
  </portal>

<portal id="cost" style="lblNormal">
  <label>
    <labeltext>
      @text = field[grCost].text
      </labeltext>
    </label>
  </portal>