Skip to content

Commit

Permalink
Merge pull request #36 from traP-jp/client/conf/devtool
Browse files Browse the repository at this point in the history
🔧 pixi.jsのインスペクタ用設定
  • Loading branch information
ikura-hamu authored Jan 22, 2025
2 parents 77cb939 + d66f15a commit 384b345
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions client/src/pixi/Canvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -129,6 +137,7 @@ const Canvas: React.FC<Props> = (props) => {
options={{ background: 0x1099bb }}
className={props.className}
onClick={onFieldClick}
onMount={mountHandler}
>
<World
userPosition={userPosition}
Expand Down

0 comments on commit 384b345

Please sign in to comment.