var gdjs;(function(n){const s=GlobalPIXIModule.PIXI;class o{constructor(e,i){this._profilerText=null;this._showCursorAtNextRender=!1;this._pixiRenderer=i?i.getPIXIRenderer():null,this._runtimeScene=e,this._pixiContainer=new s.Container,this._pixiContainer.sortableChildren=!0}onGameResolutionResized(){if(!this._pixiRenderer)return;const e=this._runtimeScene.getGame();this._pixiContainer.scale.x=this._pixiRenderer.width/e.getGameResolutionWidth(),this._pixiContainer.scale.y=this._pixiRenderer.height/e.getGameResolutionHeight()}onSceneUnloaded(){}render(){!this._pixiRenderer||(this._pixiRenderer.backgroundColor=this._runtimeScene.getBackgroundColor(),this._pixiRenderer.render(this._pixiContainer),this._showCursorAtNextRender&&(this._pixiRenderer.view.style.cursor="",this._showCursorAtNextRender=!1))}_renderProfileText(){const e=this._runtimeScene.getProfiler();if(!e)return;this._profilerText||(this._profilerText=new s.Text(" ",{align:"left",stroke:"#FFF",strokeThickness:1}),this._pixiContainer.addChild(this._profilerText));const i=e.getFramesAverageMeasures(),r=[];n.Profiler.getProfilerSectionTexts("All",i,r),this._profilerText.text=r.join(`
`)}hideCursor(){this._showCursorAtNextRender=!1,!!this._pixiRenderer&&(this._pixiRenderer.view.style.cursor="none")}showCursor(){this._showCursorAtNextRender=!0}getPIXIContainer(){return this._pixiContainer}getRendererObject(){return this._pixiContainer}getPIXIRenderer(){return this._pixiRenderer}setLayerIndex(e,i){const r=e.getRenderer();let t=r.getRendererObject();e.isLightingLayer()&&(t=r.getLightingSprite()),!!t&&this._pixiContainer.children.indexOf(t)!==i&&(this._pixiContainer.removeChild(t),this._pixiContainer.addChildAt(t,i))}}n.RuntimeScenePixiRenderer=o,n.RuntimeSceneRenderer=n.RuntimeScenePixiRenderer})(gdjs||(gdjs={}));
//# sourceMappingURL=runtimescene-pixi-renderer.js.map
