Canvas.getItemIdNear

Get an item id nearest to coordinates. If more than one item is at the same closest distance (e.g. two items overlap the point), then the top-most of these items (the last one in the display list) is used. If radius is specified, then it must be a non-negative value. Any item closer than halo to the point is considered to overlap it.

class Canvas
int
getItemIdNear
(
int xPos
,
int yPos
,
uint radius = 0
)

Parameters

xPos int

The horizontal position.

yPos int

The vertical position.

radius uint

The radius around the point.

Return Value

Type: int

The item found.

Meta