diff --git a/src/editor/viewport/GameViewport.ts b/src/editor/viewport/GameViewport.ts index 0e134a77..a1ba27b1 100644 --- a/src/editor/viewport/GameViewport.ts +++ b/src/editor/viewport/GameViewport.ts @@ -6,7 +6,7 @@ import { type FederatedPointerEvent, Text } from 'pixi.js'; import { isSymbolType } from '../../core/model/AssetTypes'; import type { EditorState } from '../state'; import type { World } from '../../runtime/World'; -import { textStyle, ui } from '../../ui'; +import { Theme, textStyle, ui } from '../../ui'; import { type ActiveCamera, cameraOfItems, cameraOfWorld } from '../../viewport/activeCamera'; import { collectHolderItems, collectWorldItems } from '../../viewport/items'; import { @@ -19,8 +19,6 @@ import { } from '../../viewport/view'; import { type Frame, WorldViewport } from './WorldViewport'; -const LETTERBOX_COLOR = 0x000000; - export class GameViewport extends WorldViewport { private readonly hint = new Text({ text: 'No active camera', style: textStyle('muted') }); private readonly editorRunCaption = new Text({ @@ -102,7 +100,9 @@ export class GameViewport extends WorldViewport { } private modelFrame(): Frame { - return collectHolderItems(this.state.project, this.state.activeScene, LETTERBOX_COLOR, this.editorWorld); + const state = this.state; + const background = Theme.colors.background; + return collectHolderItems(state.project, state.activeScene, background, this.editorWorld); } /** @@ -134,7 +134,7 @@ export class GameViewport extends WorldViewport { } protected override get baseColor(): number { - return LETTERBOX_COLOR; + return Theme.colors.background; } protected override beforeItems(view: View | null): void { diff --git a/tools/e2e/03-play.mjs b/tools/e2e/03-play.mjs index f459dc33..c93ea81b 100644 --- a/tools/e2e/03-play.mjs +++ b/tools/e2e/03-play.mjs @@ -254,7 +254,8 @@ export async function play(t) { ); check( 'and the crate is really drawn there, not left as letterbox', - previewPixel !== '#000000', + // The letterbox is Theme.colors.background. + previewPixel !== '#1b1d22', previewPixel, ); await shot('10c-game-preview');