From d66f15ab6a20be7361efcc9a25e8eb793b424122 Mon Sep 17 00:00:00 2001 From: ikura-hamu <104292023+ikura-hamu@users.noreply.github.com> Date: Thu, 23 Jan 2025 00:24:10 +0900 Subject: [PATCH] =?UTF-8?q?:wrench:=20pixi.js=E3=81=AE=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E3=83=9A=E3=82=AF=E3=82=BF=E7=94=A8=E8=A8=AD=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/pixi/Canvas.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) 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} >