Name
GetLayerAtPos -- return topmost layer at specified position (V4.7)
Synopsis
id, name$ = GetLayerAtPos(x, y)
Function
This function returns the topmost layer at the specified position. This is useful when creating some interactive user interface where layers can be moved with the mouse or hovering over a layer changes the style of that very layer. The position passed to this function is relative to the top-left corner of the display, i.e. a position of (0,0) means the top-left corner.

GetLayerAtPos() returns the identifier of the topmost layer at the specified position as well as the name of that layer. If the layer does not have a name, an empty string is returned as the second return value. If there is no layer at the specified position at all, 0 is returned as the identifier and an empty string as the name.

Inputs
x
x position to query
y
y position to query
Results
id
identifier of the topmost layer at this position or 0 if there is no layer at this position
name$
name of the topmost layer or empty string ("") if the layer does not have a name or no layer was found

Show TOC