diff --git a/client/src/pixi/Canvas.tsx b/client/src/pixi/Canvas.tsx index 4e12a3ec..9d3489b4 100644 --- a/client/src/pixi/Canvas.tsx +++ b/client/src/pixi/Canvas.tsx @@ -13,6 +13,14 @@ import { displayPositionToPosition, } from "./Position"; import Explorer from "./components/Explorer"; +import PIXI from "pixi.js"; + +const mountHandler = import.meta.env.PROD + ? (app: PIXI.Application) => { + // settings for pixi.js devtool https://github.com/bfanger/pixi-inspector + (globalThis as any).__PIXI_APP__ = app; // eslint-disable-line + } + : undefined; interface Props { className?: string; @@ -129,6 +137,7 @@ const Canvas: React.FC = (props) => { options={{ background: 0x1099bb }} className={props.className} onClick={onFieldClick} + onMount={mountHandler} >