Scene Context: Difference between revisions
m Scene Context Transitions moved to Scene Context |
|||
Line 30: | Line 30: | ||
==Target References{{anchor|references}}== | ==Target References{{anchor|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 | 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 differences are detailed below. The complete list of target references for scenes is presented in the table below. | ||
:{| class="infotable" | :{| class="infotable" |
Latest revision as of 01:20, 8 December 2008
Context: HL Kit … Kit Reference … Multiple Sources
Jump to: Target References
The "scene" context identifies the top-level visual element within the current hierarchy, which will be either a panel, a form, or a sheet.
Context Transitions
From within a "scene" context, you can utilize the following set of valid context transitions:
layout[id] Transitions to the layout context corresponding to the layout within the current scene that possesses the id specified. If the layout does not exist within the scene, the transition fails to resolve.
Example: this.layout[mylayout]
container Transitions to the container context corresponding to the container to which the scene 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 scene 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 "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 differences are detailed below. The complete list of target references for scenes is presented in the table below.
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.
Example: result = this.width
Example: this.width = 420height (Left, Right, Number) Accesses the height of the scene. The same rules apply as for the "width" target reference above.
Example: result = this.height
Example: this.height = 420scrollbar (Right, Number) Returns the width of a scroller, in pixels.
Example: result = this.scrollbar
defwidth (Right, Number) Returns the default width for a form that is specified within the form's definition. Only applicable to forms.
Example: result = this.defwidth
defheight (Right, Number) Returns the default height for a form that is specified within the form's definition. Only applicable to forms.
Example: result = this.defheight
minwidth (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.
Example: result = this.minwidth
Example: this.minwidth = 420minheight (Left, Right, Number) Accesses the minimum height governing the form. The same rules apply as for the "minwidth" target reference above.
Example: result = this.minheight
Example: this.minheight = 420maxwidth (Left, Right, Number) Accesses the maximum width governing the form. The same rules apply as for the "minwidth" target reference above.
Example: result = this.maxwidth
Example: this.maxwidth = 420maxheight (Left, Right, Number) Accesses the maximum height governing the form. The same rules apply as for the "minwidth" target reference above.
Example: result = this.maxheight
Example: this.maxheight = 420