MatchResult
find()、exist()、wait() などの検出メソッドが返す一致結果です。一致した矩形、スコア、ラベルを保持し、クリック系のメソッドに直接渡せます。
メソッド
| メソッド | 説明 |
|---|---|
getX() / getY() | 一致した領域の左上隅 |
getWidth() / getHeight() | 一致した領域のサイズ |
getMiddleX() / getMiddleY() | 中心座標 |
getMiddlePoint() | 中心を Point として取得 |
getRegion() | 一致結果を Region として取得 |
getScore() | 0 から 1 までの一致の信頼度 |
getLabel() | 認識されたテキスト、またはテンプレートのラベル |
highlight() | 一致結果をしばらく画面に描画 |
例
local result = Screen:find("buy.png")
if result then
toast("Score: " .. result:getScore())
Screen:click(result:getMiddlePoint())
end