GestureRecorder()
The user plays a routine once on their own screen. Every tap, hold and swipe is recorded and passed on to the app, so they can play normally. The answer is a record name for Record:play().
In the Block Editor this is the touch recorder block.
Constructor
GestureRecorder(id: number, text: string)
GestureRecorder(id: number, text: string, defaultRecord: string)
Parameters
| Parameters | Type | Description |
|---|---|---|
| id | number | The question's id, for Dialog:getValueById() |
| text | string | The instruction, such as "Play your route once" |
| defaultRecord | string | Optional. The name of one of your touch records, played until the user records their own |
Example
Dialog:init()
Dialog:add(GestureRecorder(1, "Play your route once"))
Dialog:showIfNeeded()
Record:play(Dialog:getValueById(1))
Notes
- The answer is
"@dialog/<id>"for the user's recording, ordefaultRecordwhile they use yours. - It plays at the pace the user played. See
Record:play()for speed and delay. - Without a default, the user must record before OK.
- The recording is saved when the user presses OK. If their screen size changes, the dialog asks them to record again.