Add DevTools

This commit is contained in:
billsonnn 2024-03-26 16:35:35 -04:00
parent 20e2c371e5
commit 926d5f8085
2 changed files with 23 additions and 0 deletions

21
src/DevTools.ts Normal file
View File

@ -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<any>[];
};
}
}
window.NitroDevTools = {
getRoomEngine: () => GetRoomEngine(),
showTextureCache: () => GetRenderer().texture.managedTextures,
};

View File

@ -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';