From 926d5f8085189b93e90fa3afa032618b66817452 Mon Sep 17 00:00:00 2001 From: billsonnn Date: Tue, 26 Mar 2024 16:35:35 -0400 Subject: [PATCH] Add DevTools --- src/DevTools.ts | 21 +++++++++++++++++++++ src/index.ts | 2 ++ 2 files changed, 23 insertions(+) create mode 100644 src/DevTools.ts diff --git a/src/DevTools.ts b/src/DevTools.ts new file mode 100644 index 00000000..ec41fb76 --- /dev/null +++ b/src/DevTools.ts @@ -0,0 +1,21 @@ +import { GetRoomEngine, RoomEngine } from '@nitrots/room'; +import { GetRenderer } from '@nitrots/utils'; +import { TextureSource } from 'pixi.js'; +export { }; + +declare global +{ + interface Window + { + NitroDevTools?: + { + getRoomEngine(): RoomEngine; + showTextureCache(): TextureSource[]; + }; + } +} + +window.NitroDevTools = { + getRoomEngine: () => GetRoomEngine(), + showTextureCache: () => GetRenderer().texture.managedTextures, +}; diff --git a/src/index.ts b/src/index.ts index 803857d1..b2d0f959 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,6 +2,7 @@ import { AbstractRenderer, BrowserAdapter, DOMAdapter, HelloSystem } from 'pixi. HelloSystem.defaultOptions.hello = true; AbstractRenderer.defaultOptions.failIfMajorPerformanceCaveat = false; +//TextureSource.defaultOptions.scaleMode = 'nearest'; DOMAdapter.set(BrowserAdapter); export * from '@nitrots/api'; @@ -16,4 +17,5 @@ export * from '@nitrots/room'; export * from '@nitrots/session'; export * from '@nitrots/sound'; export * from '@nitrots/utils'; +export * from './DevTools'; export * from './pixi-proxy';