게임 만들기

showDialog

Renders a modal dialog that traps focus above the game canvas. Automatically wires confirm/cancel callbacks and returns a close handle.

showDialog

Renders a modal dialog that traps focus above the game canvas. Automatically wires confirm/cancel callbacks and returns a close handle.

Examples

const { close } = showDialog({
  title: "Matchmaking",
  content: "Waiting for another pilot...",
  cancelText: "Cancel",
  onCancel: () => matchmaking.abort(),
});
 
setTimeout(close, 10_000);

Signature

showDialog(options: DialogOptions): { close: () => void; }