From 835e1b2e1cf9ffff0156670480077eeeb4910407 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Wed, 27 Feb 2019 15:04:03 -0800 Subject: [PATCH] Sim gif generation (#1877) * enable simulator screenshot * use viewhost screenshotAsync facility * setup giftransparency * tweak css for gif generation * patch colors * update theme * specify custom gif color * moving as experiement * bump pxt --- docs/static/experiments/simgif.png | Bin 0 -> 12265 bytes docs/static/experiments/simscreenshot.png | Bin 0 -> 8967 bytes package.json | 2 +- pxtarget.json | 8 ++++++-- sim/dalboard.ts | 11 +++++------ sim/state/microservo.ts | 2 +- sim/visuals/microbit.ts | 14 ++++++++++---- 7 files changed, 23 insertions(+), 14 deletions(-) create mode 100644 docs/static/experiments/simgif.png create mode 100644 docs/static/experiments/simscreenshot.png diff --git a/docs/static/experiments/simgif.png b/docs/static/experiments/simgif.png new file mode 100644 index 0000000000000000000000000000000000000000..6d96f4be023d8d7e4c3974d714aa95edef8196e0 GIT binary patch literal 12265 zcmbulby$>L)IK^h3=M)JB`BfN-Cas|cL_s?G)PG!sDO00bW8V8QbTu#0@4lAa2|Ml z-*a8(`{R7){Qj5?GtYkZUVE*z?{%-e*JmXKNoYmEzI%I()cp3^3f(qbupl?#!6TvRd0zA1+kL5f{JHWsif9x8JOqg# zpe6c0X`AJi;tU`3)GT_@8+uj+eWUqOp0Q~S5xzN#BIVhyAmxAGcY;n4fZL$Vj3wk^{n2htbm3cFo(mqerZQ8LyG9SVC5{C6`11=`mCuPsLs`nyHAejpAR zQ}fkf@K#jIa&gT9#u?iqu}{K06Hq%nQZipSSKT9hc^@hf zG<%kQ8%V?ZoyaniE*UW~KRu6~s>4=PvRW0jqjntO?qpua7tG9xOz^Webz3D33YTOk zXo)oo?u84n2??}#RC3|W@Uyn6D!yzQGCv<19Q>)}N@RWf|en^{%wcXZBoY8Lf$#TAlyD8d8|KOOJPYVILj zx?k?ptd8ZYa+<9eJc|y)6-)Fp;{?-NJkQ&mZ_qUBPt5k;{@EVnoQQ<_pn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#Xy+kkC*2RvFScw~_J6iJY)`RHYTUikPK^iBuv!AlY}sY_5$VP0aGMERR7;qx)Vg)qJnaWGTrg`0)X;-khHkM>k=^| GzyAyCNf2-V literal 0 HcmV?d00001 diff --git a/docs/static/experiments/simscreenshot.png b/docs/static/experiments/simscreenshot.png new file mode 100644 index 0000000000000000000000000000000000000000..1219d76e09d91ea5e457031c51e98fc1b8e45b93 GIT binary patch literal 8967 zcmeHtXEdDc_io-q5TZpVh%O|$kwKIgHBlo()Is!KMkk_2?`5>;qK!7nD9Px-FbJau zF@({hw=;SF=dAPle?04)kLSbvJkP$?zW2WNwfB0~J+q!@ZA}$25+;&cw{DTCse*Lz z_hbC}Nlb{p3g<#K@wb0GbX8v5szE*cjW-Bv6f_iW-Kt9HO@pKJ zj=A-dvrAdBTFp1P2D{fg!1bwWqdAsF4{tHM{yc0u%Q;kOiOE7A&TI#dmqulVlTz;w z&fXbjk?0<|blJ8;VLm4S{mM+OyK)g(&%J+J`EAdB^IT}^^PG2*oLH>SU2~>7UT8{T zguk@$7(g{)!&v;Y7^UwEPX{^(dAJ~SutkFtJs!$uqpgR-5s;!0r>TV2ISSFTZOrs5 zOvO~}VrwO%?bSxBga1UyPnEcmUn+82{R1X#S#Hu^lCQmSPJ)Y_U51WVZyl~q-DeF~ ze2XrJVrQ_QAs3k?65YckbGvq>+nD~?=AhX6pg+w)e_%nL@E}jvddy)F!(6kAi{CMh zaVR^R$xZJ4dyoBeB3x9o#w;{MI?FA;`$Bv70^T%wPyIyUy$33}z z*?~@q${1q)3K#_(DZ5B=aeJ%($5g@_eQmZ<%3~>ka-*sO!G@37&Ud|vX(wgxf;r2% zkgRnt4a89AZiPpdrL@OK`j`_#xlYw5xR{YU@K8gGtJ9jJRlTkLW#Tyq12IBBygC+) zMaq6vp0=!pjm~~Hqx9->QEEF&wCs%#a0{gcd~9o1EsmvzurdFLd?KA9yI(nAI(zkFgT&Qs=|TnfSPk zQO(<)aIWM#UOk(%zGZd$DhKB6P>a+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jFc|b%i^4>)-ml0>WIUkV!pb7lGsglyJZdkPn2VNbl)b2Uqvjl1CT?r!#ao8X^sk29ituApS z2xQ_r%%#sOsm~D8cB^Pr`uJD`C~O=%f5|riDu#9i--XjO9eO9dKQ9v#c@Ls7!hD zz#M@z3xBaprH3I2kJJVW(6GJ;uh#Y { super.initAsync(msg); - const options = (msg.options || {}) as RuntimeOptions; - const boardDef = msg.boardDefinition; const cmpsList = msg.parts; const cmpDefs = msg.partDefinitions || {}; @@ -136,20 +135,20 @@ namespace pxsim { maxHeight: "100%", highContrast: msg.highContrast }; - const viewHost = new visuals.BoardHost(pxsim.visuals.mkBoardView({ + this.viewHost = new visuals.BoardHost(pxsim.visuals.mkBoardView({ visual: boardDef.visual, boardDef: boardDef, highContrast: msg.highContrast }), opts); document.body.innerHTML = ""; // clear children - document.body.appendChild(this.view = viewHost.getView()); + document.body.appendChild(this.view = this.viewHost.getView()); return Promise.resolve(); } - screenshot(): string { - return svg.toDataUri(new XMLSerializer().serializeToString(this.view)); + screenshotAsync(): Promise { + return this.viewHost.screenshotAsync(); } } diff --git a/sim/state/microservo.ts b/sim/state/microservo.ts index 30c6971d..5eb54d58 100644 --- a/sim/state/microservo.ts +++ b/sim/state/microservo.ts @@ -10,7 +10,7 @@ namespace pxsim.visuals { - + diff --git a/sim/visuals/microbit.ts b/sim/visuals/microbit.ts index f08bc552..0987215c 100644 --- a/sim/visuals/microbit.ts +++ b/sim/visuals/microbit.ts @@ -17,7 +17,9 @@ namespace pxsim.visuals { .sim-button { pointer-events: none; } - + .sim-board, .sim-display, sim-button { + fill: #111; + } .sim-button-outer:hover { stroke:grey; stroke-width: 3px; @@ -241,14 +243,14 @@ path.sim-board { export var themes: IBoardTheme[] = ["#3ADCFE", "#FFD43A", "#3AFFB3", "#FF3A54"].map(accent => { return { accent: accent, - display: "#000", + display: "#111", pin: "#D4AF37", pinTouched: "#FFA500", pinActive: "#FF5500", ledOn: "#ff7f7f", ledOff: "#202020", buttonOuter: "#979797", - buttonUp: "#000", + buttonUp: "#111", buttonDown: "#FFA500", virtualButtonOuter: "#333", virtualButtonUp: "#fff", @@ -761,6 +763,7 @@ path.sim-board { "y": "0px", "width": MB_WIDTH + "px", "height": MB_HEIGHT + "px", + "fill": "rgba(0,0,0,0)" }); this.style = svg.child(this.element, "style", {}); this.style.textContent = MB_STYLE + (this.props.theme.highContrast ? MB_HIGHCONTRAST : ""); @@ -785,10 +788,12 @@ path.sim-board { for (let i = 0; i < 3; ++i) svg.child(merge, "feMergeNode", { in: "glow" }) // outline - svg.path(this.g, "sim-board", "M498,31.9C498,14.3,483.7,0,466.1,0H31.9C14.3,0,0,14.3,0,31.9v342.2C0,391.7,14.3,406,31.9,406h434.2c17.6,0,31.9-14.3,31.9-31.9V31.9z M14.3,206.7c-2.7,0-4.8-2.2-4.8-4.8c0-2.7,2.2-4.8,4.8-4.8c2.7,0,4.8,2.2,4.8,4.8C19.2,204.6,17,206.7,14.3,206.7z M486.2,206.7c-2.7,0-4.8-2.2-4.8-4.8c0-2.72.2-4.8,4.8-4.8c2.7,0,4.8,2.2,4.8,4.8C491,204.6,488.8,206.7,486.2,206.7z"); + const pkg = svg.path(this.g, "sim-board", "M498,31.9C498,14.3,483.7,0,466.1,0H31.9C14.3,0,0,14.3,0,31.9v342.2C0,391.7,14.3,406,31.9,406h434.2c17.6,0,31.9-14.3,31.9-31.9V31.9z M14.3,206.7c-2.7,0-4.8-2.2-4.8-4.8c0-2.7,2.2-4.8,4.8-4.8c2.7,0,4.8,2.2,4.8,4.8C19.2,204.6,17,206.7,14.3,206.7z M486.2,206.7c-2.7,0-4.8-2.2-4.8-4.8c0-2.72.2-4.8,4.8-4.8c2.7,0,4.8,2.2,4.8,4.8C491,204.6,488.8,206.7,486.2,206.7z"); + svg.hydrate(pkg, { fill: "#111" }); // script background this.display = svg.path(this.g, "sim-display", "M333.8,310.3H165.9c-8.3,0-15-6.7-15-15V127.5c0-8.3,6.7-15,15-15h167.8c8.3,0,15,6.7,15,15v167.8C348.8,303.6,342.1,310.3,333.8,310.3z"); + svg.hydrate(this.display, { fill: "#111" }); this.logos = []; this.logos.push(svg.child(this.g, "polygon", { class: "sim-theme", points: "115,56.7 173.1,0 115,0" })); @@ -876,6 +881,7 @@ path.sim-board { this.buttons.push(svg.child(this.g, "circle", { class: "sim-button", cx: 446, cy: 278, r: 16.5 })); (this.buttonsOuter[2]).style.visibility = "hidden"; (this.buttons[2]).style.visibility = "hidden"; + this.buttons.forEach(btn => svg.hydrate(btn, { fill: "#111" })); svg.path(this.g, "sim-label", "M35.7,376.4c0-2.8,2.1-5.1,5.5-5.1c3.3,0,5.5,2.4,5.5,5.1v4.7c0,2.8-2.2,5.1-5.5,5.1c-3.3,0-5.5-2.4-5.5-5.1V376.4zM43.3,376.4c0-1.3-0.8-2.3-2.2-2.3c-1.3,0-2.1,1.1-2.1,2.3v4.7c0,1.2,0.8,2.3,2.1,2.3c1.3,0,2.2-1.1,2.2-2.3V376.4z"); svg.path(this.g, "sim-label", "M136.2,374.1c2.8,0,3.4-0.8,3.4-2.5h2.9v14.3h-3.4v-9.5h-3V374.1z");