CoordToPixel

(Engine-Level Function)

Description: Takes a specified coordinate pair within a given window and returns the overall, onscreen pixel location.
Returns: Numeric
Usage: Script Only.
Function Groups: Graphics,  Window
Related to: Coordinates
Format: CoordToPixel(Object, CoordX, CoordY, Option)
Parameters:  
Object
Required. The window context that the coordinates are taken from.
CoordX
Required. Any numeric expression giving the x-coordinate to convert.
CoordY
Required. Any numeric expression giving the y-coordinate to convert.
Option
Required. Any numeric expression specifying the converted coordinate to return, where 0 returns the converted x-coordinate, and 1 returns the converted y-coordinate.
Comments: This function's return value is determined by the Option parameter.

Example:

  If 1 Main;
  [
    xPixel = CoordToPixel(Self(), xCoord, yCoord, 0);
    yPixel = CoordToPixel(Self(), xCoord, yCoord, 1);
  ]

This converts the point specified by the user coordinates (xCoord, yCoord) in the current module to screen coordinates (pixel location).