var gdjs;(function(g){class R{constructor(l){this._debugDraw=null;this._debugDrawContainer=null;this._instanceContainer=l,this._debugDrawRenderedObjectsPoints={},this._debugDraw=null}getRendererObject(){return this._debugDrawContainer}renderDebugDraw(l,h,D,_){const P=this._instanceContainer.getRenderer().getRendererObject();(!this._debugDraw||!this._debugDrawContainer)&&(this._debugDrawContainer=new PIXI.Container,this._debugDraw=new PIXI.Graphics,this._debugDrawContainer.addChild(this._debugDraw),P.addChild(this._debugDrawContainer));const t=this._debugDraw;for(let i in this._debugDrawRenderedObjectsPoints)this._debugDrawRenderedObjectsPoints[i].wasRendered=!1;const u=(i,e,n,c,r)=>{t.line.color=n,t.fill.color=n,t.drawCircle(c,r,3),D&&(i[e]||(i[e]=new PIXI.Text(e,{fill:n,fontSize:12}),this._debugDrawContainer.addChild(i[e])),i[e].position.set(c,r))};t.clear(),t.beginFill(),t.alpha=.8,t.lineStyle(2,255,1);const s=[0,0];for(let i=0;i{b=n.applyLayerTransformation(b[0],b[1],0,s),d.push(b[0]),d.push(b[1])}),t.fill.alpha=0,t.line.alpha=.5,t.line.color=16711680,t.drawPolygon(d)}t.fill.alpha=.3;const w=n.applyLayerTransformation(e.getCenterXInScene(),e.getCenterYInScene(),0,s);u(o.points,"Center",16776960,w[0],w[1]);const f=n.applyLayerTransformation(e.getX(),e.getY(),0,s);if(u(o.points,"Position",16711680,f[0],f[1]),e instanceof g.SpriteRuntimeObject){let a=e.getPointPosition("origin");(Math.abs(a[0]-f[0])>=1||Math.abs(a[1]-f[1])>=1)&&(a=n.applyLayerTransformation(a[0],a[1],0,s),u(o.points,"Origin",16711680,a[0],a[1]))}if(_&&e instanceof g.SpriteRuntimeObject){if(!e._animationFrame)continue;for(const a in e._animationFrame.points.items){let d=e.getPointPosition(a);d=n.applyLayerTransformation(d[0],d[1],0,s),u(o.points,a,255,d[0],d[1])}}}for(const i in this._debugDrawRenderedObjectsPoints){const e=this._debugDrawRenderedObjectsPoints[i];if(e.wasRendered)continue;const n=e.points;for(const c in n)this._debugDrawContainer.removeChild(n[c])}t.endFill()}clearDebugDraw(){this._debugDraw&&this._debugDraw.clear(),this._debugDrawContainer&&(this._debugDrawContainer.destroy({children:!0}),this._instanceContainer.getRenderer().getRendererObject().removeChild(this._debugDrawContainer)),this._debugDraw=null,this._debugDrawContainer=null,this._debugDrawRenderedObjectsPoints={}}}g.DebuggerPixiRenderer=R,g.DebuggerRenderer=g.DebuggerPixiRenderer})(gdjs||(gdjs={})); //# sourceMappingURL=DebuggerPixiRenderer.js.map