Motion.wait
luastra/motionMotion.wait(durationMs: number): Wait
Creates a non-visual delay step for Motion.sequence. It advances no property itself and exists only to postpone the next Tween in the same channel.
Before you use it
Add luastra/motion to this module's dependencies in luastra.json, then import it with require("luastra/motion"). Motion itself needs no capability; a visible result requires ui.render and a component that accepts the returned descriptor through its motion field.
How it fits
The function returns immutable motion data synchronously. Assign a preset MotionMap directly, or place Tween/Sequence values under supported motion channel names; the host animates without rerunning app.render on every frame.
When to use it
Use Motion.wait between sequence steps when timing is part of the visual story, such as holding a revealed state before returning. Use Timer instead when the delay must change application state or dispatch application logic.
Parameters
| Parameter | Type / values | Description |
|---|---|---|
| durationMs | number | Non-negative delay in milliseconds before the next sequence step. |
Returns
Wait — an immutable delay step for a motion sequence.
What happens next
A descriptor or MotionMap ready to attach to a supported UI node.
Failures and fixes
Unknown options, invalid bounds, or unsupported channels fail validation. Motion must not drive application logic; use Timer for state changes, and rely on the host to present the final state when reduced motion is enabled.
Availability
Public-source alpha API in 0.5.0-alpha; presentation follows host and reduced-motion policy.
Focused example
local Motion = require("luastra/motion")
local pause = Motion.wait(500)