support for recorder (#361)

This commit is contained in:
Peli de Halleux 2017-03-01 14:24:59 -08:00 committed by GitHub
parent 2cd3bca8db
commit bd1f5a2b75

View File

@ -16,6 +16,9 @@ namespace pxsim {
neopixelState: NeoPixelState; neopixelState: NeoPixelState;
fileSystem: FileSystemState; fileSystem: FileSystemState;
// visual
view: SVGElement;
constructor() { constructor() {
super() super()
@ -123,10 +126,14 @@ namespace pxsim {
}), opts); }), opts);
document.body.innerHTML = ""; // clear children document.body.innerHTML = ""; // clear children
document.body.appendChild(viewHost.getView()); document.body.appendChild(this.view = viewHost.getView());
return Promise.resolve(); return Promise.resolve();
} }
screenshot(): string {
return svg.toDataUri(new XMLSerializer().serializeToString(this.view));
}
} }
export function initRuntimeWithDalBoard() { export function initRuntimeWithDalBoard() {