跳到主要内容

MatchResult:getLabel()

返回与匹配结果关联的标签:OCR 匹配时为识别出的文本,设置了模板标签时为该标签。

签名​

getLabel(): string

返回值

string - 标签;没有关联标签时为空字符串。

描述​

对于文本检测,这是匹配到的文本,在搜索使用子串或不区分大小写比较时很有用。对于图像检测,它通常为空。

示例​

local result = Screen:find("submit", FinderParams():setDetectionType("TEXT"))
if result then
toast("Found: " .. result:getLabel())
end