MatchList

A read-only list of Match values returned by region.find_any/find_all/find_multi, wait_any/wait_all, and Recognition.result when multiple recognition targets matched.

Syntax

MatchList

This class cannot be constructed directly.

Returns

—

Example

hits = Region(100, 200, 300, 400).find_all(["hp", "mp"], 5000)
if hits:
    click(hits, offset=(0, 4), random=0)

Methods

2 methods

MatchList.highlight

Draw highlight frames for each found match in this list. Items without a valid match point/bounds are skipped.

Syntax

matches.highlight(color="green", line_width=2, region_width=36, auto_hide_ms=0)

Parameters

NameDescription
colorColor | String | Number
Highlight color.
Optional · Positional or named
Default: green
line_widthNumber
Outline width in pixels.
Optional · Positional or named
Default: 2
region_widthNumber
Fallback square width when a match has point only.
Optional · Positional or named
Default: 36
auto_hide_msNumber
Auto-hide timeout in milliseconds. 0 keeps highlight visible.
Optional · Positional or named
Default: 0

Returns

MatchList — Returns the same match list after drawing highlights.

Example

hits = Region(100, 200, 300, 400).find_any(["enemy_a", "enemy_b"], 2500)
hits.highlight(color="yellow", line_width=3, auto_hide_ms=1200)

MatchList.highlight_off

Turn off all active highlights generated from this match list instance.

Syntax

matches.highlight_off()

Returns

MatchList — Returns the same match list after turning highlight off.

Example

hits = Region(100, 200, 300, 400).find_any(["enemy_a", "enemy_b"], 2500)
hits.highlight()
hits.highlight_off()