Method XbpWindow():mapPoint() Foundation

Map a point from one coordinate space to another

Syntax
:mapPoint( <oXbpDest>, <aPos> ) --> aPosMapped
Parameters
<oXbpDest>
<oXbpDest> contains the Xbase Part which defines the coordinate space the point is mapped to. The object passed in this parameter must be derived from either the class XbpWindow or XbpCrt.
<aPos>
<aPos> is an array containing the x and y coordinates of the point to be mapped to another coordinate space.
Return

The method returns an array with two elements. It contains the x and y coordinates of the point specified relative to the coordinate system defined by<oXbpDest>.

Description

Method :mapPoint() maps a point from the coordinate space of the object executing the method (self) to that of another Xbase Part. Mapping points becomes necessary when a certain coordinate is used with an Xbase Part which is located at another level in the parent/child hierarchy. For example, the function GetPointerPos() returns the mouse pointer position in screen coordinates (see function AppDesktop()). To move a certain Xbase Part to the position of the mouse pointer, the position first has to be mapped to the Xbase Part's parent object. For this, the function :mapPoint() can be used.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.