var gdjs;(function(i){class s{constructor(t,e){this._object=t,this._pixiObject=new MultiStyleText(t._text,{default:{fontFamily:e.getGame().getFontManager().getFontFamily(t._fontFamily),fontSize:t._fontSize+"px",fill:i.rgbToHexNumber(t._color[0],t._color[1],t._color[2]),tagStyle:"bbcode",wordWrap:t._wrapping,wordWrapWidth:t._wrappingWidth,align:t._textAlign}}),e.getLayer("").getRenderer().addRendererObject(this._pixiObject,t.getZOrder()),this.updateAlignment(),this.updateText(),this.updatePosition(),this.updateAngle(),this.updateOpacity()}getRendererObject(){return this._pixiObject}updateWordWrap(){this._pixiObject._style.wordWrap=this._object._wrapping,this._pixiObject.dirty=!0,this.updatePosition()}updateWrappingWidth(){this._pixiObject._style.wordWrapWidth=this._object._wrappingWidth,this._pixiObject.dirty=!0,this.updatePosition()}updateText(){this._pixiObject.text=this._object._text,this.updatePosition()}updateColor(){this._pixiObject.textStyles.default.fill=i.rgbToHexNumber(this._object._color[0],this._object._color[1],this._object._color[2]),this._pixiObject.dirty=!0}updateAlignment(){this._pixiObject._style.align=this._object._textAlign,this._pixiObject.dirty=!0}updateFontFamily(){this._pixiObject.textStyles.default.fontFamily=this._object.getInstanceContainer().getGame().getFontManager().getFontFamily(this._object._fontFamily),this._pixiObject.dirty=!0}updateFontSize(){this._pixiObject.textStyles.default.fontSize=this._object._fontSize+"px",this._pixiObject.dirty=!0}updatePosition(){if(this._object.isWrapping()&&this._pixiObject.width!==0){const e=this._object._textAlign==="right"?1:this._object._textAlign==="center"?.5:0,o=this._object.getWrappingWidth(),h=(o-this._pixiObject.width)*(e-.5);this._pixiObject.position.x=this._object.x+o/2,this._pixiObject.anchor.x=.5-h/this._pixiObject.width}else this._pixiObject.position.x=this._object.x+this._pixiObject.width/2,this._pixiObject.anchor.x=.5;const t=this._object._verticalTextAlignment==="bottom"?1:this._object._verticalTextAlignment==="center"?.5:0;this._pixiObject.position.y=this._object.y+this._pixiObject.height*(.5-t),this._pixiObject.anchor.y=.5}updateAngle(){this._pixiObject.rotation=i.toRad(this._object.angle)}updateOpacity(){this._pixiObject.alpha=this._object._opacity/255}getWidth(){return this._pixiObject.width}getHeight(){return this._pixiObject.height}destroy(){this._pixiObject.destroy(!0)}}i.BBTextRuntimeObjectPixiRenderer=s,i.BBTextRuntimeObjectRenderer=s})(gdjs||(gdjs={}));
//# sourceMappingURL=bbtextruntimeobject-pixi-renderer.js.map
