Aller au contenu principal

MatchResult:getPoint()

Returns the center point of the matched region as a Point object.

Description

The getPoint() method returns a Point object representing the center coordinates of the matched area. This is a convenient way to get both the X and Y center coordinates at once, and the returned Point can be used directly with touch methods.

The center point coordinates are equivalent to getMiddleX() and getMiddleY().

Signature

getPoint(): Point

Returns

Point - A Point object containing the center X and Y coordinates of the matched region.

Example

local result = Screen:find("button.png")
if result then
local point = result:getPoint()
-- Use the point directly for tapping
Screen:click(point)
end