メインコンテンツまでスキップ

MatchResult:getPoint()

一致した領域の中心点を Point オブジェクトとして返します。

説明

getPoint() メソッドは、一致した領域の中心座標を表す Point オブジェクトを返します。これにより、X と Y の中心座標を一度に取得でき、返された Point をタッチメソッドで直接使用できます。

中心点の座標は getMiddleX()getMiddleY() に相当します。

シグネチャ

getPoint(): Point

戻り値

Point - 一致した領域の中心の X 座標と Y 座標を含む Point オブジェクト。

local result = Screen:find("button.png")
if result then
local point = result:getPoint()
-- 取得した point を直接タップに使用
Screen:click(point)
end