Scene Context: Difference between revisions
New page: {{context|Kit Reference|Context Transitions}} See Also: Scene Target References From within a "scene" context, you can utilize the following set of valid context transitions: :{| cl... |
No edit summary |
||
Line 1: | Line 1: | ||
{{ | {{contextmulti|Kit Reference}} | ||
Jump to: [[#references|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{{anchor|transitions}}== | |||
From within a "scene" context, you can utilize the following set of valid context transitions: | From within a "scene" context, you can utilize the following set of valid context transitions: | ||
Line 7: | Line 11: | ||
:{| class="infotable" | :{| class="infotable" | ||
|class="leftnormal"|layout[''id''] | |class="leftnormal"|layout[''id''] | ||
|Transitions to the [[Layout Context | |Transitions to the [[Layout Context|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.<br> | ||
Example: this.layout[mylayout] | Example: this.layout[mylayout] | ||
|- | |- | ||
|container | |container | ||
|Transitions to the [[Container Context | |Transitions to the [[Container Context|container context]] corresponding to the container to which the scene 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 17: | Line 21: | ||
|- | |- | ||
|hero | |hero | ||
|Transitions to the [[Hero Context | |Transitions to the [[Hero Context|hero context]] corresponding to the hero to which the scene 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 "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. | |||
:{| class="infotable" | |||
|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> | |||
Example: result = this.width<br> | |||
Example: this.width = 420 | |||
|- | |||
|height | |||
|(Left, Right, Number) Accesses the height of the scene. The same rules apply as for the "width" target reference above.<br> | |||
Example: result = this.height<br> | |||
Example: this.height = 420 | |||
|- | |||
|scrollbar | |||
|(Right, Number) Returns the width of a scroller, in pixels.<br> | |||
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.<br> | |||
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.<br> | |||
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.<br> | |||
Example: result = this.minwidth<br> | |||
Example: this.minwidth = 420 | |||
|- | |||
|minheight | |||
|(Left, Right, Number) Accesses the minimum height governing the form. The same rules apply as for the "minwidth" target reference above.<br> | |||
Example: result = this.minheight<br> | |||
Example: this.minheight = 420 | |||
|- | |||
|maxwidth | |||
|(Left, Right, Number) Accesses the maximum width governing the form. The same rules apply as for the "minwidth" target reference above.<br> | |||
Example: result = this.maxwidth<br> | |||
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 | |||
|- | |- | ||
|} | |} |
Revision as of 23:30, 7 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 different 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