timer
A countdown timer that reads a Unix-millisecond deadline from screen.data and renders the remaining duration. Re-renders once per second while mounted.
The deadline is interpreted against the relay’s wall clock — not the phone’s — so countdowns stay consistent across players whose device clocks may be off. The SDK learns the offset from heartbeat ping timestamps.
C# factory
WidgetDefinitions.Timer( id: "countdown", positionX: 0.5f, positionY: 0.2f, sizeW: 0.4f, sizeH: 0.1f, endsAtKey: "round_ends_at", format: "mm:ss", label: "Time left: {value}", style: "title");
// Then push the deadline:manager.UpdateScreenDataForAll("round", new{ round_ends_at = DateTimeOffset.UtcNow.AddSeconds(60).ToUnixTimeMilliseconds()});Wire format
| Field | Type | Required | Notes |
|---|---|---|---|
id | string | yes | |
type | "timer" | yes | |
position_x, position_y, size_w, size_h | number | no | 0..1 anchor + size. |
ends_at_key | string | no | Data key holding a unix-ms deadline. Default ends_at. |
format | "mm:ss" | "seconds" | no | Render format. Default "mm:ss". |
label | string | no | Wrapping template. Use {value} for the formatted duration. |
style | "title" | "subtitle" | "body" | no | Typographic preset. |
align | "left" | "center" | "right" | no | |
color | string | no | 7-digit hex. |
Events
Display only.
Example
// Start a 30-second round — every connected phone counts down in sync.manager.ShowScreenToAll("round", new{ round_ends_at = DateTimeOffset.UtcNow.AddSeconds(30).ToUnixTimeMilliseconds()});