OnControl (Kernel)

OnControl(map x y)
OnControl(map left top width height)

Checks to see which colors are at the specified coords or in the rect. It checks the specified map and returns a 16 bit color map.

Parameters:
  • map (number) – ocVISUAL, ocPRIORITY or ocSPECIAL (ocSPECIAL is the control information).
  • x (number) – The x coordinate.
  • y (number) – The y coordinate.
  • left (number) – Left side of the rectangle.
  • top (number) – Top of the rectangle.
  • width (number) – Width of the rectangle.
  • height (number) – Height of the rectangle.

Example:

; Using a point
(if (== ctlRED (OnControl ocSPECIAL 120 90))
        (Print "It is on a red control line!")
)

; Using a rect, multiple colors may be returned, so you should use the & operator.
(if (& ctlBLUE (OnControl ocSPECIAL 50 20 100 40)
        (Print "It is on a blue control line!")
)