Skip to main content

Image Rect Picker

Allows selecting a rectangular area on a screenshot to obtain its vertices and size.

Type rect returns an array of four numbers: x1, y1, x2, y2 for the top-left and bottom-right corners.

{ 0, 534, 295, 626 }

Example

local group, name

group = 'Image/Color'
name = 'text = screen.ocr_text(rect)'

return {
name = string.format('%s - %s', group, name),
description = "OCR text in a screen region",
arguments = {
{type = 'rect'},
},
generator = function(rect)
return string.format('text = screen.ocr_text(%d, %d, %d, %d)', rect[1], rect[2], rect[3], rect[4])
end,
}

IMG_0015.PNG