Difference between revisions of "Portal Target References"

From HLKitWiki
Jump to: navigation, search
Line 8: Line 8:
 
|class="leftnormal"|width
 
|class="leftnormal"|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.<br>
 
|(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.<br>
Example: result = this.width<br>
+
Example: result = portal[portalid].width<br>
Example: this.width = 42
+
Example: portal[portalid].width = 42
 
|-
 
|-
 
|height
 
|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.<br>
 
|(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.<br>
Example: result = this.height<br>
+
Example: result = portal[portalid].height<br>
Example: this.height = 42
+
Example: portal[portalid]height = 42
 
|-
 
|-
 
|left
 
|left
 
|(Left, Right, Number) Accesses the position of the left edge of the portal within the containing visual element.<br>
 
|(Left, Right, Number) Accesses the position of the left edge of the portal within the containing visual element.<br>
Example: result = this.left<br>
+
Example: result = portal[portalid].left<br>
Example: this.left = 42
+
Example: portal[portalid].left = 42
 
|-
 
|-
 
|top
 
|top
 
|(Left, Right, Number) Accesses the position of the top edge of the portal within the containing visual element.<br>
 
|(Left, Right, Number) Accesses the position of the top edge of the portal within the containing visual element.<br>
Example: result = this.top<br>
+
Example: result = portal[portalid].top<br>
Example: this.top = 42
+
Example: portal[portalid].top = 42
 
|-
 
|-
 
|right
 
|right
 
|(Right, Number) Returns the position of the right edge of the portal within the containing visual element.<br>
 
|(Right, Number) Returns the position of the right edge of the portal within the containing visual element.<br>
Example: result = this.right
+
Example: result = portal[portalid].right
 
|-
 
|-
 
|bottom
 
|bottom
 
|(Right, Number) Returns the position of the bottom edge of the portal within the containing visual element.<br>
 
|(Right, Number) Returns the position of the bottom edge of the portal within the containing visual element.<br>
Example: result = this.bottom
+
Example: result = portal[portalid].bottom
 
|-
 
|-
 
|visible
 
|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.<br>
 
|(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.<br>
Example: result = this.visible<br>
+
Example: result = portal[portalid].visible<br>
Example: this.visible = 1
+
Example: portal[portalid].visible = 1
 
|-
 
|-
 
|scrollbar
 
|scrollbar
 
|(Right, Number) Returns the width of a scroller, in pixels.<br>
 
|(Right, Number) Returns the width of a scroller, in pixels.<br>
Example: result = this.scrollbar
+
Example: result = portal[portalid].scrollbar
|-
+
|autotop
+
|(Left, Right, Number) Accesses the position of the top edge of the auto-place region within the containing visual element.<br>
+
Example: result = this.autotop<br>
+
Example: this.autotop = 42
+
|-
+
|autobottom
+
|(Left, Right, Number) Accesses the position of the bottom edge of the auto-place region within the containing visual element.<br>
+
Example: result = this.autobottom<br>
+
Example: this.autobottom = 420
+
|-
+
|autoleft
+
|(Left, Right, Number) Accesses the position of the left edge of the auto-place region within the containing visual element.<br>
+
Example: result = this.autoleft<br>
+
Example: this.autoleft = 42
+
|-
+
|autoright
+
|(Left, Right, Number) Accesses the position of the right edge of the auto-place region within the containing visual element.<br>
+
Example: result = this.autoright<br>
+
Example: this.autoright = 420
+
 
|-
 
|-
 
|autowidth
 
|autowidth
|(Left, Right, Number) Accesses the width of the auto-place region within the containing visual element.<br>
+
|(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.<br>
Example: result = this.autowidth<br>
+
Example: perform portal[portalid].autowidth<br>
Example: this.autowidth = 420
+
 
|-
 
|-
 
|autoheight
 
|autoheight
|(Left, Right, Number) Accesses the height of the auto-place region within the containing visual element.<br>
+
|(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.<br>
Example: result = this.autoheight<br>
+
Example: perform portal[portalid].autoheight<br>
Example: this.autoheight = 420
+
 
|-
 
|-
|autogap
+
|autosize
|(Left, Right, Number) Accesses the default gap size used when automatically placing elements within the containing visual element. The "autogap" defaults to zero.<br>
+
|(Right, Number) Calling "autosize" has the same effect as performing both an "autowidth" and an "autoheight".<br>
Example: result = this.autogap<br>
+
Example: perform portal[portalid].autosize<br>
Example: this.autogap = 42
+
 
|-
 
|-
 
|autoplace[''gap'']
 
|autoplace[''gap'']
 
|(Right, Number) Automatically places the portal within the containing layout, subject to the standard rules for [[Using Automatic Placement|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.<br>
 
|(Right, Number) Automatically places the portal within the containing layout, subject to the standard rules for [[Using Automatic Placement|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.<br>
Example: perform this.autoplace[42]<br>
+
Example: perform portal[portalid].autoplace[42]<br>
Example: perform this.autoplace
+
Example: perform portal[portalid].autoplace
 
|-
 
|-
 
|}
 
|}

Revision as of 13:32, 8 June 2009

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