GetXformRefBox
(Engine-Level Function)
Description: | Get Transform Reference Box. This function returns the reference box for any transform of a module. |
Returns: | Numeric |
Usage: | Script or steady state. |
Function Groups: | Compilation and On-Line Modifications, Graphics, Advanced Module, Window |
Related to: | GetModuleRefBox | GUITransform | UnTransform |
Format: | GetXformRefBox(Object, Option) |
Parameters: |
Object | ||||||||||
Required. Any expression which gives the object value for the transformed module instance. | ||||||||||
Option | ||||||||||
Required. Any expression that defines the requested return value as indicated by the following:
|
Comments: |
This function will only return the reference box of a transform immediately acting upon the module indicated by Object. It will not search for a transform that may be acting upon the module's parent or ancestors. If the module indicated by Object is not under the influence of a transform, the return value will be Invalid. This function is unaffected by the Untransform statement. Even if the module has been untransformed, it will still be able to retrieve the reference box of a transform that would be otherwise acting upon it. |
Example:
Suppose that a module calls module Motor inside of a transform as follows:
GUITransform(0, 100, 100, 0 { Bounding box for transform }, 1, 1, 1, 1, 1 { No scaling }, 0, 0 { No trajectory or rotation }, 1 { Module graphics are visible }, 0 { Reserved }, 0, 0, 0 { Cannot be focused/selected }, Motor() { Module to transform });
Further suppose that Motor needs to know its exact location in the window - it is inside of the transform and is therefore unaware of its (the transform's) parameters. This can be done by the following:
Right = GetXFormRefBox(Self(), 2);
The variable right will contain the X-coordinate for the right of the transform's reference box, which in this case will be 100. If the transform's position in the window were to change, the value of this variable would similarly change.