var gdjs;(function(i){class n extends i.RuntimeObject{constructor(t,e){super(t,e);this._wrappingWidth=250;this._opacity=parseFloat(e.content.opacity),this._text=e.content.text,this._color=i.rgbOrHexToRGBColor(e.content.color),this._fontFamily=e.content.fontFamily,this._fontSize=parseFloat(e.content.fontSize),this._wordWrap=e.content.wordWrap,this._align=e.content.align,this._renderer=new i.BBTextRuntimeObjectRenderer(this,t),this.hidden=!e.content.visible,this.onCreated()}getRendererObject(){return this._renderer.getRendererObject()}updateFromObjectData(t,e){return t.content.opacity!==e.content.opacity&&this.setOpacity(e.content.opacity),t.content.visible!==e.content.visible&&this.hide(!e.content.visible),t.content.text!==e.content.text&&this.setBBText(e.content.text),t.content.color!==e.content.color&&(this._color=i.rgbOrHexToRGBColor(e.content.color),this._renderer.updateColor()),t.content.fontFamily!==e.content.fontFamily&&this.setFontFamily(e.content.fontFamily),t.content.fontSize!==e.content.fontSize&&this.setFontSize(e.content.fontSize),t.content.wordWrap!==e.content.wordWrap&&this.setWordWrap(e.content.wordWrap),t.content.align!==e.content.align&&this.setAlignment(e.content.align),!0}extraInitializationFromInitialInstance(t){t.customSize?this.setWrappingWidth(t.width):this.setWrappingWidth(250)}onDestroyFromScene(t){super.onDestroyFromScene(t)}setBBText(t){this._text=t,this._renderer.updateText()}getBBText(){return this._text}setColor(t){this._color=i.rgbOrHexToRGBColor(t),this._renderer.updateColor()}getColor(){return this._color[0]+";"+this._color[1]+";"+this._color[2]}setFontSize(t){this._fontSize=t,this._renderer.updateFontSize()}getFontSize(){return this._fontSize}setFontFamily(t){this._fontFamily=t,this._renderer.updateFontFamily()}getFontFamily(){return this._fontFamily}setAlignment(t){this._align=t,this._renderer.updateAlignment()}getAlignment(){return this._align}setX(t){super.setX(t),this._renderer.updatePosition()}setY(t){super.setY(t),this._renderer.updatePosition()}setAngle(t){super.setAngle(t),this._renderer.updateAngle()}setOpacity(t){t<0&&(t=0),t>255&&(t=255),this._opacity=t,this._renderer.updateOpacity()}getOpacity(){return this._opacity}setWrappingWidth(t){this._wrappingWidth!==t&&(this._wrappingWidth=t,this._renderer.updateWrappingWidth(),this.invalidateHitboxes())}getWrappingWidth(){return this._wrappingWidth}setWordWrap(t){this._wordWrap!==t&&(this._wordWrap=t,this._renderer.updateWordWrap(),this.invalidateHitboxes())}getWordWrap(){return this._wordWrap}getWidth(){return this._renderer.getWidth()}getHeight(){return this._renderer.getHeight()}}i.BBTextRuntimeObject=n,i.registerObject("BBText::BBText",i.BBTextRuntimeObject)})(gdjs||(gdjs={}));
//# sourceMappingURL=bbtextruntimeobject.js.map
