Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

refactor(editor): warm the engine loop before the screenshot capture

esengine0976f1e6a45c
diff --git a/desktop/electron/main.ts b/desktop/electron/main.ts
index d6014da04..e37739345 100644
--- a/desktop/electron/main.ts
+++ b/desktop/electron/main.ts
@@ -186,7 +186,7 @@ async function runScreenshot(w: BrowserWindow, out: string): Promise<void> {
await settleFrames(2); // was sleep(400)
}
}
- await settleFrames(4); // was sleep(2500) — dockview + the WebGL viewport paint
+ await settleFrames(12); // was sleep(2500) — let the engine loop spin up + fully paint the WebGL viewport
const img = await w.webContents.capturePage();
await writeFile(out, img.toPNG());
console.log('[screenshot] wrote', out);