Skip to main content

MatchResult:getY()

Returns the Y coordinate of the top-left corner of the matched region.

Description

The getY() method returns the vertical position (Y coordinate) of the top-left corner where the match was found on the screen. This value represents the pixel position from the top edge of the screen.

Signature

getY(): number

Returns

number - The Y coordinate (in pixels) of the top-left corner of the matched region.

Example

local result = Screen:find("template.png")
if result then
local y = result:getY()
toast("Match found at Y position: " .. y)
end