Sheet Element (Data): Difference between revisions
New page: {{context|Kit Reference|Data File Reference}} ==The "sheet" Element== Sheets contain one or more layouts and orchestrate the presentation of material within a specific page of a char... |
|||
Line 40: | Line 40: | ||
:{| class="infotable" | :{| class="infotable" | ||
|class="leftnormal"|PCDATA | |class="leftnormal"|PCDATA | ||
| | |TagExpr – Specifies the code comprising the Live tag expression. | ||
|- | |- | ||
|} | |} |
Latest revision as of 22:49, 3 December 2008
Context: HL Kit … Kit Reference … Data File Reference
The "sheet" Element
Sheets contain one or more layouts and orchestrate the presentation of material within a specific page of a character sheet. Each sheet is specified through the use of a "sheet" element. The complete list of attributes for this element is below.
id Id – Specifies the unique id of the sheet. This id is used in all references to the sheet. name Text – Public name associated with the sheet. Maximum length of 50 characters. landscape (Optional) Boolean – Indicates whether the sheet is to be output in landscape or portrait orientation. Default: "no". spillover (Optional) Boolean – Indicates whether this sheet utilized spillover behaviors or not. If spillover behavior is enabled, the sheet is output repeatedly until all objects rendered via the page have been output. Default: "no".
The "sheet" element also possesses child elements that define various facets of the sheet. 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.
live An optional "live" element may appear as defined by the given link. This element defines a Live Tag Expression that determines whether the sheet is actually output for the character. layoutref Zero or more "layoutref" elements may appear as defined by the given link. This element specifies the individual layouts which are utilized within the sheet. position An optional "position" element may appear as defined by the given link. This element defines a Position Script through which the contained layouts are sized and positioned within the sheet.
The "live" Element
The "live" element defines a Live Tag Expression for the sheet, which determines whether the sheet is included in the output. The tag expression is compared against the tags assigned to the actor being output. If the tag expression is satisfied, the sheet is output, else it is omitted. The complete list of attributes for this element is below.
PCDATA TagExpr – Specifies the code comprising the Live tag expression.
The "layoutref" Element
The "layoutref" element identifies a layout used within the sheet and assigns it a logical name for use within the Position script. The complete list of attributes for this element is below.
layout Id – Unique id of the layout to be utilized within the sheet. reference (Optional) Id – Specifies the alternate unique id to be used when referencing this layout within the Position script. This makes it possible to re-use the same layout more than once within the same sheet, giving each instance a different logical id. If empty, the reference id is simply the layout id. Default: Empty.
The "position" Element
The "position" element defines a Position Script for the sheet, which performs all the appropriate sizing and positioning of the contained layouts within the sheet. The complete list of attributes for this element is below.
PCDATA Script – Specifies the code comprising the Position script.
Example
The following example demonstrates what a "sheet" element might look like. All default values are assumed for optional attributes.
<sheet id="standard2" name="Standard character sheet, page #2" spillover="yes"> <layoutref layout="oStandard2" reference="left"/> <layoutref layout="oStandard2" reference="right"/> <position> ~setup the gap to be used between the various sections of the character sheet autogap = 40 global[sectiongap] = autogap ~calculate the width of the two columns of the character sheet, leaving a ~suitable center gap between them var colwidth as number colwidth = (width - 50) / 2 ~output the layout on the lefthand side with whatever information will fit layout[left].width = colwidth layout[left].height = height perform layout[left].render ~output the layout on the righthand side with whatever information will fit layout[right].width = colwidth layout[right].height = height perform layout[right].render </position> </sheet>