var gdjs;(function(r){const o=GlobalPIXIModule.PIXI;class s{constructor(e,n,t){this._isContainerDirty=!0;this._debugDraw=null;this._debugDrawContainer=null;this._object=e,this._instanceContainer=n,this._pixiContainer=new o.Container,this._debugDrawRenderedObjectsPoints={},this._pixiContainer.sortableChildren=!0,this._debugDraw=null;const i=t.getLayer("");i&&i.getRenderer().addRendererObject(this._pixiContainer,e.getZOrder())}reinitialize(e,n){this._object=e,this._isContainerDirty=!0;const t=n.getLayer("");t&&t.getRenderer().addRendererObject(this._pixiContainer,e.getZOrder())}getRendererObject(){return this._pixiContainer}_updatePIXIContainer(){this._pixiContainer.pivot.x=this._object.getUnscaledCenterX(),this._pixiContainer.pivot.y=this._object.getUnscaledCenterY(),this._pixiContainer.position.x=this._object.getX()+this._pixiContainer.pivot.x*Math.abs(this._object._scaleX),this._pixiContainer.position.y=this._object.getY()+this._pixiContainer.pivot.y*Math.abs(this._object._scaleY),this._pixiContainer.rotation=r.toRad(this._object.angle),this._pixiContainer.scale.x=this._object._scaleX,this._pixiContainer.scale.y=this._object._scaleY,this._pixiContainer.visible=!this._object.hidden,this._pixiContainer.alpha=this._object.opacity/255,this._isContainerDirty=!1}ensureUpToDate(){this._isContainerDirty&&this._updatePIXIContainer()}update(){this._isContainerDirty=!0}updateX(){this._pixiContainer.position.x=this._object.x+this._pixiContainer.pivot.x*Math.abs(this._object._scaleX)}updateY(){this._pixiContainer.position.y=this._object.y+this._pixiContainer.pivot.y*Math.abs(this._object._scaleY)}updateAngle(){this._pixiContainer.rotation=r.toRad(this._object.angle)}updateOpacity(){this._pixiContainer.alpha=this._object.opacity/255}updateVisibility(){this._pixiContainer.visible=!this._object.hidden}getPIXIContainer(){return this._pixiContainer}getPIXIRenderer(){return null}setLayerIndex(e,n){const t=e.getRenderer();let i=t.getRendererObject();e.isLightingLayer()&&(i=t.getLightingSprite()),!!i&&this._pixiContainer.children.indexOf(i)!==n&&(this._pixiContainer.removeChild(i),this._pixiContainer.addChildAt(i,n))}}r.CustomObjectPixiRenderer=s,r.CustomObjectRenderer=r.CustomObjectPixiRenderer})(gdjs||(gdjs={}));
//# sourceMappingURL=CustomObjectPixiRenderer.js.map
