UnTransform

(Engine-Level Function)

Description: Will undo a previous transform so that the module instance and everything it has called will not be transformed.
Returns: Nothing
Usage: Script Only.
Function Groups: Graphics,  Advanced Module
Related to: GUITransform | GetXformRefBox
Format: Untransform(Object)
Parameters:  
Object
Required. Any expression which gives the object value for the instance to be untransformed.
Comments: This function is used to allow a module instance to draw in the default window coordinates even if the instance is contained within a transform.
This statement may only appear in a script.

Example:

Suppose that the System module calls module Pump inside of a transform as follows:

GUITransform(0, 90, 90, 0 { Bounding box for transform },
             1, 1, 1, 1, 1 { No scaling }, 
             0, 0 { No trajectory or rotation }, 
             1, 0 { Graphics visible; reserved }, 
             0, 0, 0 { Cannot be focused }, 
             Pump() { Module to transform });

Now let us further suppose that Pump calls a module named Reservoir. This module will also be affected by the transform of its caller unless it uses Untransform to nullify the effects of the transform performed on Pump. The following is the first state of module Reservoir:

Init [
  If 1 Main; 
  [ 
    Untransform(Self());
  ] 
]

With this as its first state, Reservoir will now be drawn in the window as if it were called directly from System, that is to say, it will not be affected whatsoever by the transform that resizes its caller, Pump. Notice that the Untransform function need only be called once; no matter what further state changes occur within Reservoir, it will remain unaffected by the transform that affects Pump.