Layout Target References: Difference between revisions

From HLKitWiki
Jump to navigationJump to search
New page: {{context|Kit Reference|Target References}} The "scene" script context applies equally to panels, forms, and sheets. However, there are some important behavioral differences between those...
 
No edit summary
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{context|Kit Reference|Target References}}
{{context|Kit Reference|Target References}}


The "scene" script context applies equally to panels, forms, and sheets. However, there are some important behavioral differences between those three visual elements that impact how certain target references operate for each, and those different are detailed below. The complete list of target references for scenes is presented in the table below.
See Also: [[Layout Context Transitions]]
 
The "layout" script context governs the operations that can be applied to layouts within scenes. The complete list of target references for layouts is presented in the table below.


:{| class="infotable"
:{| class="infotable"
|class="leftnormal"|width
|class="leftnormal"|width
|(Left, Right, Number) Accesses the width of the scene. The width of panels and sheets is properly setup by HL and any changes are completely ignored, as HL wholly controls the rendering region for panels and sheets. For forms, the width is initialized to something safe by HL, but the author is assumed to set the width appropriately for the contents that need to be displayed.<br>
|(Left, Right, Number) Accesses the width of the layout. Unless explicitly specified within the XML, the width of a layout is initialized to the width of the containing scene, minus any assigned margins.<br>
Example: result = this.width<br>
Example: result = this.width<br>
Example: this.width = 420
Example: this.width = 420
|-
|-
|height
|height
|(Left, Right, Number) Accesses the height of the scene. The same rules apply as for the "width" target reference above.<br>
|(Left, Right, Number) Accesses the height of the scene. Unless explicitly specified within the XML, the height of a layout is initialized to the height of the containing scene, minus any assigned margins.<br>
Example: result = this.height<br>
Example: result = this.height<br>
Example: this.height = 420
Example: this.height = 420
|-
|-
|scrollbar
|left
|(Right, Number) Returns the width of a scroller, in pixels.<br>
|(Left, Right, Number) Accesses the position of the left edge of the layout within the containing visual element.<br>
Example: result = this.scrollbar
Example: result = this.left<br>
Example: this.left = 42
|-
|-
|defwidth
|top
|(Right, Number) Returns the default width for a form that is specified within the form's definition. Only applicable to forms.<br>
|(Left, Right, Number) Accesses the position of the top edge of the layout within the containing visual element.<br>
Example: result = this.defwidth
Example: result = this.top<br>
Example: this.top = 42
|-
|-
|defheight
|right
|(Right, Number) Returns the default height for a form that is specified within the form's definition. Only applicable to forms.<br>
|(Right, Number) Returns the position of the right edge of the layout within the containing visual element.<br>
Example: result = this.defheight
Example: result = this.right
|-
|-
|minwidth
|bottom
|(Left, Right, Number) Accesses the minimum width governing the form. A value of zero indicates the minimum width should be the default width. If both minwidth and maxwidth are zero, the form cannot be resized by the user. If data files specify both minwidth and maxwidth as zero, the form width cannot be modified via scripts. If the min/max values are modified such that the current dimensions of the form become invalid, the form dimensions are automatically adjusted to comply with the new limits. Only applicable to forms.<br>
|(Right, Number) Returns the position of the bottom edge of the layout within the containing visual element.<br>
Example: result = this.minwidth<br>
Example: result = this.bottom
Example: this.minwidth = 420
|-
|-
|minheight
|visible
|(Left, Right, Number) Accesses the minimum height governing the form. The same rules apply as for the "minwidth" target reference above.<br>
|(Left, Right, Number) Controls the visibility of the layout within the containing visual element. A non-zero value indicates the layout is visible and a zero value indicates hidden.<br>
Example: result = this.minheight<br>
Example: result = this.visible<br>
Example: this.minheight = 420
Example: this.visible = 1
|-
|-
|maxwidth
|scrollbar
|(Left, Right, Number) Accesses the maximum width governing the form. The same rules apply as for the "minwidth" target reference above.<br>
|(Right, Number) Returns the width of a scroller, in pixels.<br>
Example: result = this.maxwidth<br>
Example: result = this.scrollbar
Example: this.maxwidth = 420
|-
|maxheight
|(Left, Right, Number) Accesses the maximum height governing the form. The same rules apply as for the "minwidth" target reference above.<br>
Example: result = this.maxheight<br>
Example: this.maxheight = 420
|-
|-
|autotop
|autotop
|(Left, Right, Number)  
|(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
|autobottom
|(Left, Right, Number)  
|(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
|autoleft
|(Left, Right, Number)  
|(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
|autoright
|(Left, Right, Number)  
|(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)  
|(Left, Right, Number) Accesses the width of the auto-place region within the containing visual element.<br>
Example: result = this.autowidth<br>
Example: this.autowidth = 420
|-
|-
|autoheight
|autoheight
|(Left, Right, Number)  
|(Left, Right, Number) Accesses the height of the auto-place region within the containing visual element.<br>
Example: result = this.autoheight<br>
Example: this.autoheight = 420
|-
|-
|autogap
|autogap
|(Left, Right, Number)  
|(Left, Right, Number) Accesses the default gap size used when automatically placing elements within the containing visual element. The "autogap" defaults to zero.<br>
Example: result = this.autogap<br>
Example: this.autogap = 42
|-
|-
|autoplace[''gap'']
|autoplace[''gap'']
|(Right, Number)  
|(Right, Number) Automatically places the layout within the containing visual element, subject to the standard rules for [[Using Automatic Placement|automatic placement]]. The ''gap'' parameter specifies the gap to be used between this layout and the previous placed element. The parameter can be omitted, in which case the established "autogap" is utilized. A value of zero is always returned.<br>
Example: perform this.autoplace[42]<br>
Example: perform this.autoplace
|-
|batchplace
|(Right, Number) Automatically places all the portals and templates which were queued for [[Using Batch Placement|batch placement]] using the "batchadd" target.<br>
Example: perform this.batchplace
|-
|-
|}
|}

Latest revision as of 05:39, 20 December 2013

Context: HL Kit &#133; Kit Reference &#133; Target References 

See Also: Layout Context Transitions

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

width (Left, Right, Number) Accesses the width of the layout. Unless explicitly specified within the XML, the width of a layout is initialized to the width of the containing scene, minus any assigned margins.

Example: result = this.width
Example: this.width = 420

height (Left, Right, Number) Accesses the height of the scene. Unless explicitly specified within the XML, the height of a layout is initialized to the height of the containing scene, minus any assigned margins.

Example: result = this.height
Example: this.height = 420

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

Example: result = this.left
Example: this.left = 42

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

Example: result = this.top
Example: this.top = 42

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

Example: result = this.right

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

Example: result = this.bottom

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

Example: result = this.visible
Example: this.visible = 1

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

Example: result = this.scrollbar

autotop (Left, Right, Number) Accesses the position of the top edge of the auto-place region within the containing visual element.

Example: result = this.autotop
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.

Example: result = this.autobottom
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.

Example: result = this.autoleft
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.

Example: result = this.autoright
Example: this.autoright = 420

autowidth (Left, Right, Number) Accesses the width of the auto-place region within the containing visual element.

Example: result = this.autowidth
Example: this.autowidth = 420

autoheight (Left, Right, Number) Accesses the height of the auto-place region within the containing visual element.

Example: result = this.autoheight
Example: this.autoheight = 420

autogap (Left, Right, Number) Accesses the default gap size used when automatically placing elements within the containing visual element. The "autogap" defaults to zero.

Example: result = this.autogap
Example: this.autogap = 42

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

Example: perform this.autoplace[42]
Example: perform this.autoplace

batchplace (Right, Number) Automatically places all the portals and templates which were queued for batch placement using the "batchadd" target.

Example: perform this.batchplace