Portal Target References

From HLKitWiki
Jump to: navigation, search

Context: HL KitKit Reference … Target References 

See Also: Portal Context Transitions

The "portal" script context governs the operations that can be applied to portals within templates and layouts. The complete list of target references for portals is presented in the table below.

width (Left, Right, Number) Accesses the width of the portal. Unless explicitly specified within the XML, the width of a portal is automatically initialized appropriately to the nature of the portal. Setting the width of a table portal triggers immediate re-sizing of all items within the table.

Example: result = portal[portalid].width
Example: portal[portalid].width = 42

height (Left, Right, Number) Accesses the height of the portal. Unless explicitly specified within the XML, the height of a portal is automatically initialized appropriately to the nature of the portal. Setting the height of a table portal triggers immediate re-sizing of all items within the table.

Example: result = portal[portalid].height
Example: portal[portalid]height = 42

left (Left, Right, Number) Accesses the position of the left edge of the portal within the containing visual element.

Example: result = portal[portalid].left
Example: portal[portalid].left = 42

top (Left, Right, Number) Accesses the position of the top edge of the portal within the containing visual element.

Example: result = portal[portalid].top
Example: portal[portalid].top = 42

right (Right, Number) Returns the position of the right edge of the portal within the containing visual element.

Example: result = portal[portalid].right

bottom (Right, Number) Returns the position of the bottom edge of the portal within the containing visual element.

Example: result = portal[portalid].bottom

visible (Left, Right, Number) Controls the visibility of the portal within the containing visual element. A non-zero value indicates the portal is visible and a zero value indicates hidden.

Example: result = portal[portalid].visible
Example: portal[portalid].visible = 1

scrollbar (Right, Number) Returns the width of a scroller, in pixels.

Example: result = portal[portalid].scrollbar

autowidth (Right, Number) Sets the width of the portal to the default width based on the current style and portal contents. For example, if you change the font size of a portal, you can call "autowidth" to set the portal width appropriately for that font size and portal text.

Example: perform portal[portalid].autowidth

autoheight (Right, Number) Sets the height of the portal to the default height based on the current style and portal contents. For example, if you change the font size of a portal, you can call "autoheight" to set the portal height appropriately for that font size and portal text.

Example: perform portal[portalid].autoheight

autosize (Right, Number) Calling "autosize" has the same effect as performing both an "autowidth" and an "autoheight".

Example: perform portal[portalid].autosize

autoplace[gap] (Right, Number) Automatically places the portal within the containing layout, subject to the standard rules for automatic placement. The gap parameter specifies the gap to be used between this portal and the previously placed element. The parameter can be omitted, in which case the established "autogap" is utilized. Automatic placement for portals can only be used within layouts. A value of zero is always returned.

Example: perform portal[portalid].autoplace[42]
Example: perform portal[portalid].autoplace

batchadd[gap] (Right, Number) Queues the portal for batch placement within the containing layout, subject to the standard rules for batch placement. As with "autoplace", the gap parameter specifies the gap to be used between this portal and the previous placed element. The parameter can be omitted, in which case the established "autogap" is utilized. Batch placement for portals can only be used within layouts. A value of zero is always returned.

Example: perform portal[portalid].batchadd[42]
Example: perform portal[portalid].batchadd