From bd1f5a2b755cd095c369608107db4e121ac12963 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Wed, 1 Mar 2017 14:24:59 -0800 Subject: [PATCH] support for recorder (#361) --- sim/dalboard.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sim/dalboard.ts b/sim/dalboard.ts index b4842cf8..7f387ac9 100644 --- a/sim/dalboard.ts +++ b/sim/dalboard.ts @@ -16,6 +16,9 @@ namespace pxsim { neopixelState: NeoPixelState; fileSystem: FileSystemState; + // visual + view: SVGElement; + constructor() { super() @@ -123,10 +126,14 @@ namespace pxsim { }), opts); document.body.innerHTML = ""; // clear children - document.body.appendChild(viewHost.getView()); + document.body.appendChild(this.view = viewHost.getView()); return Promise.resolve(); } + + screenshot(): string { + return svg.toDataUri(new XMLSerializer().serializeToString(this.view)); + } } export function initRuntimeWithDalBoard() {