본문으로 건너뛰기

TapPicker()

The user taps a spot on their own screen, then drags the marker to fine-tune it. The answer is a Point.

Picking a spot

Constructor​

TapPicker(id: number, text: string)
TapPicker(id: number, text: string, default: Point)

Parameters​

ParametersTypeDescription
idnumberThe question's id, for Dialog:getValueById()
textstringThe instruction, such as "Tap the Attack button"
defaultPointOptional. Used until the user picks, so the macro works right away

Example​

Dialog:init()
Dialog:add(TapPicker(1, "Tap the Attack button"))
Dialog:showIfNeeded()
Screen:click(Dialog:getValueById(1), ClickParams())

Notes​

  • Without a default, the user must pick before OK. setRequired(false) makes it optional; the answer is then nil until they pick.
  • The default is in your macro's coordinates and is scaled like your other points. A picked spot is already on the user's screen, so it is used as it is.
  • If the user's screen size changes, the pick no longer fits and the dialog asks for it again.