Difference between revisions of "The Positioning Sequence"

From HLKitWiki
Jump to: navigation, search
(Recursive Descent Through Hierarchy)
(Recursive Descent Through Hierarchy)
Line 10: Line 10:
 
The HL engine utilizes a strict process for positioning all of the visual elements. Each top-level element (i.e. panel or sheet) is handled independently. Within the context of each top-level element, a recursive descent is performed upon all of the visual elements it contains, invoking the Position script within each visual element during the descent.  
 
The HL engine utilizes a strict process for positioning all of the visual elements. Each top-level element (i.e. panel or sheet) is handled independently. Within the context of each top-level element, a recursive descent is performed upon all of the visual elements it contains, invoking the Position script within each visual element during the descent.  
  
The overall positioning sequence can be defined as follows.
+
The overall positioning sequence can be defined as follows for a given top-level visual element.
  
#
+
#Recursively process all visual elements within the top-level element to reset their position to (0,0), perform default sizing, and initialize the default state. In general, only portals possess default sizing and state.
 +
#Invoke the Position script for the top-level visual element.
 +
#Any child layout of the top-level element that has not yet been rendered is now rendered.
  
 
==Rendering Layouts and Templates==
 
==Rendering Layouts and Templates==

Revision as of 03:44, 20 November 2008

[Context: HL KitBasic Concepts and TerminologyManipulation of Visual Elements]

The Position Script

Every visual container possesses a "position" script, which means the script is possessed by every template, layout, panel, and sheet. The Position script serves one specific purpose - to properly size, position, and configure all of the child elements within the visual container. Not every visual container needs to define a position script, since the HL engine performs some actions automatically, but most visual containers will perform at least some operations within their Position, and some will perform extensive operations to properly setup the visual elements within them.

Recursive Descent Through Hierarchy

The HL engine utilizes a strict process for positioning all of the visual elements. Each top-level element (i.e. panel or sheet) is handled independently. Within the context of each top-level element, a recursive descent is performed upon all of the visual elements it contains, invoking the Position script within each visual element during the descent.

The overall positioning sequence can be defined as follows for a given top-level visual element.

  1. Recursively process all visual elements within the top-level element to reset their position to (0,0), perform default sizing, and initialize the default state. In general, only portals possess default sizing and state.
  2. Invoke the Position script for the top-level visual element.
  3. Any child layout of the top-level element that has not yet been rendered is now rendered.

Rendering Layouts and Templates