mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-27 08:48:14 +00:00
Exclude editor visuals from screen captures
This commit is contained in:
@@ -22,7 +22,6 @@ import "./app.element.scss"
|
||||
@customElement("app-root")
|
||||
export class AppElement extends LitElement {
|
||||
@state() imageCaptureUrl?: string;
|
||||
@state() realtimeCapture = true;
|
||||
|
||||
@state() hierarchyWidth = 256;
|
||||
@state() resizing = false;
|
||||
@@ -52,12 +51,9 @@ export class AppElement extends LitElement {
|
||||
}
|
||||
|
||||
@on("entity-changes")
|
||||
@debounce(1000 / 24)
|
||||
onStudioChanges(): void {
|
||||
if (this.realtimeCapture) {
|
||||
this.requestScreenshot_realtime();
|
||||
} else {
|
||||
this.requestScreenshot_delayed();
|
||||
}
|
||||
studio.requestScreenshot();
|
||||
}
|
||||
|
||||
@on("viewport-resized")
|
||||
@@ -67,16 +63,6 @@ export class AppElement extends LitElement {
|
||||
studio.requestScreenshot();
|
||||
}
|
||||
|
||||
@debounce(1000 / 24, { maxWait: 1000 / 5 })
|
||||
requestScreenshot_realtime() {
|
||||
studio.requestScreenshot();
|
||||
}
|
||||
|
||||
@debounce(1000 / 24)
|
||||
requestScreenshot_delayed() {
|
||||
studio.requestScreenshot();
|
||||
}
|
||||
|
||||
@on("screenshot-ready")
|
||||
onScreenshotReady({ detail: screenshot }: ScreenshotReadyEvent) {
|
||||
const prevUrl = this.imageCaptureUrl;
|
||||
@@ -101,11 +87,6 @@ export class AppElement extends LitElement {
|
||||
this.hierarchyWidth = Math.max(Math.min(updated, 512), 128);
|
||||
}
|
||||
|
||||
toggleRealtimeCapture(event: InputEvent): void {
|
||||
const { checked } = event.target as HTMLInputElement;
|
||||
this.realtimeCapture = checked;
|
||||
}
|
||||
|
||||
refreshSeed(): void {
|
||||
this.seed = randomSeed();
|
||||
}
|
||||
@@ -184,6 +165,11 @@ export class AppElement extends LitElement {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
${/*
|
||||
FIXME: Real-time capture is not really feasible until we can come up
|
||||
with a more elegant way to exclude the world grid, gizmos, etc.
|
||||
from the captured image
|
||||
|
||||
<div class="config v-start h-end">
|
||||
<label class="config-checkbox">
|
||||
<input
|
||||
@@ -194,6 +180,8 @@ export class AppElement extends LitElement {
|
||||
Realtime Capture
|
||||
</label>
|
||||
</div>
|
||||
*/
|
||||
nothing}
|
||||
|
||||
${this.loading ? html`
|
||||
<!-- TODO: Animated spinner or something -- talk to our designers -->
|
||||
|
||||
Reference in New Issue
Block a user