Layout Context: Difference between revisions

From HLKitWiki
Jump to navigationJump to search
New page: {{context|Kit Reference|Context Transitions}} See Also: Layout Target References From within a "layout" context, you can utilize the following set of valid context transitions: :{| ...
 
No edit summary
Line 1: Line 1:
{{context|Kit Reference|Context Transitions}}
{{contextmulti|Kit Reference}}


See Also: [[Layout Target References]]
Jump to: [[#references|Target References]]
 
The "layout" context identifies a layout within the top-level scene of the current hierarchy.
 
==Context Transitions{{anchor|transitions}}==


From within a "layout" context, you can utilize the following set of valid context transitions:
From within a "layout" context, you can utilize the following set of valid context transitions:
Line 7: Line 11:
:{| class="infotable"
:{| class="infotable"
|class="leftnormal"|parent
|class="leftnormal"|parent
|Transitions to the [[Scene Context Transitions|scene context]] corresponding to the visual element that contains the layout.<br>
|Transitions to the [[Scene Context|scene context]] corresponding to the visual element that contains the layout.<br>
Example: this.parent
Example: this.parent
|-
|-
|template[''id'']
|template[''id'']
|Transitions to the [[Template Context Transitions|template context]] corresponding to the template within the current layout that possesses the ''id'' specified. If the template does not exist within the layout, the transition fails to resolve.<br>
|Transitions to the [[Template Context|template context]] corresponding to the template within the current layout that possesses the ''id'' specified. If the template does not exist within the layout, the transition fails to resolve.<br>
Example: this.template[mytemplate]<br>
Example: this.template[mytemplate]<br>
{{note}}The id specified is the id of the template '''reference''', as defined within the layout, and not necessarily the id of the template itself.
{{note}}The id specified is the id of the template '''reference''', as defined within the layout, and not necessarily the id of the template itself.
|-
|-
|portal[''id'']
|portal[''id'']
|Transitions to the [[Portal Context Transitions|portal context]] corresponding to the portal within the current layout that possesses the ''id'' specified. If the portal does not exist within the layout, the transition fails to resolve.<br>
|Transitions to the [[Portal Context|portal context]] corresponding to the portal within the current layout that possesses the ''id'' specified. If the portal does not exist within the layout, the transition fails to resolve.<br>
Example: this.portal[myportal]<br>
Example: this.portal[myportal]<br>
{{note}}The id specified is the id of the portal '''reference''', as defined within the layout, and not necessarily the id of the portal itself.<br>
{{note}}The id specified is the id of the portal '''reference''', as defined within the layout, and not necessarily the id of the portal itself.<br>
Line 22: Line 26:
|-
|-
|container
|container
|Transitions to the [[Container Context Transitions|container context]] corresponding to the container to which the layout applies, whether it be an actor or a gizmo.<br>
|Transitions to the [[Container Context|container context]] corresponding to the container to which the layout applies, whether it be an actor or a gizmo.<br>
Example: this.container<br>
Example: this.container<br>
{{note}}After transitioning, access within the new container context will be read-only and limited in what information can be retrieved.<br>
{{note}}After transitioning, access within the new container context will be read-only and limited in what information can be retrieved.<br>
Line 28: Line 32:
|-
|-
|hero
|hero
|Transitions to the [[Hero Context Transitions|hero context]] corresponding to the hero to which the layout applies.<br>
|Transitions to the [[Hero Context|hero context]] corresponding to the hero to which the layout applies.<br>
Example: this.hero<br>
Example: this.hero<br>
{{note}}After transitioning, access within the new hero context will be read-only and limited in what information can be retrieved.<br>
{{note}}After transitioning, access within the new hero context will be read-only and limited in what information can be retrieved.<br>
{{note}}This transition can only be used as the '''first''' transition when within a visual script.  
{{note}}This transition can only be used as the '''first''' transition when within a visual script.  
|-
|}
==Target References{{anchor|references}}==
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="leftnormal"|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.<br>
Example: result = this.width<br>
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.<br>
Example: result = this.height<br>
Example: this.height = 420
|-
|left
|(Left, Right, Number) Accesses the position of the left edge of the layout within the containing visual element.<br>
Example: result = this.left<br>
Example: this.left = 42
|-
|top
|(Left, Right, Number) Accesses the position of the top edge of the layout within the containing visual element.<br>
Example: result = this.top<br>
Example: this.top = 42
|-
|right
|(Right, Number) Returns the position of the right edge of the layout within the containing visual element.<br>
Example: result = this.right
|-
|bottom
|(Right, Number) Returns the position of the bottom edge of the layout within the containing visual element.<br>
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.<br>
Example: result = this.visible<br>
Example: this.visible = 1
|-
|scrollbar
|(Right, Number) Returns the width of a scroller, in pixels.<br>
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.<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
|(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
|(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
|(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'']
|(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
|-
|-
|}
|}

Revision as of 23:33, 7 December 2008

Context: HL Kit &#133; Kit Reference  &#133; Multiple Sources

Jump to: Target References

The "layout" context identifies a layout within the top-level scene of the current hierarchy.

Context Transitions

From within a "layout" context, you can utilize the following set of valid context transitions:

parent Transitions to the scene context corresponding to the visual element that contains the layout.

Example: this.parent

template[id] Transitions to the template context corresponding to the template within the current layout that possesses the id specified. If the template does not exist within the layout, the transition fails to resolve.

Example: this.template[mytemplate]
NOTE! The id specified is the id of the template reference, as defined within the layout, and not necessarily the id of the template itself.

portal[id] Transitions to the portal context corresponding to the portal within the current layout that possesses the id specified. If the portal does not exist within the layout, the transition fails to resolve.

Example: this.portal[myportal]
NOTE! The id specified is the id of the portal reference, as defined within the layout, and not necessarily the id of the portal itself.
NOTE! Only portals defined directly within the layout can be accessed via this transition. Portals within templates must be accessed via the template.

container Transitions to the container context corresponding to the container to which the layout applies, whether it be an actor or a gizmo.

Example: this.container
NOTE! After transitioning, access within the new container context will be read-only and limited in what information can be retrieved.
NOTE! This transition can only be used as the first transition when within a visual script.

hero Transitions to the hero context corresponding to the hero to which the layout applies.

Example: this.hero
NOTE! After transitioning, access within the new hero context will be read-only and limited in what information can be retrieved.
NOTE! This transition can only be used as the first transition when within a visual script.

Target References

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