var gdjs;(function(i){class s extends i.RuntimeObject{constructor(e,t){super(e,t);this.opacity=255;this._rBorder=t.rightMargin,this._lBorder=t.leftMargin,this._tBorder=t.topMargin,this._bBorder=t.bottomMargin,this._tiled=t.tiled,this._width=t.width,this._height=t.height,this._renderer=new i.PanelSpriteRuntimeObjectRenderer(this,e,t.texture,t.tiled),this.onCreated()}updateFromObjectData(e,t){e.width!==t.width&&this.setWidth(t.width),e.height!==t.height&&this.setHeight(t.height);let r=!1;return e.rightMargin!==t.rightMargin&&(this._rBorder=t.rightMargin,r=!0),e.leftMargin!==t.leftMargin&&(this._lBorder=t.leftMargin,r=!0),e.topMargin!==t.topMargin&&(this._tBorder=t.topMargin,r=!0),e.bottomMargin!==t.bottomMargin&&(this._bBorder=t.bottomMargin,r=!0),e.texture!==t.texture&&(r=!0),r&&this.setTexture(t.texture,this.getRuntimeScene()),e.tiled===t.tiled}getRendererObject(){return this._renderer.getRendererObject()}onDestroyFromScene(e){super.onDestroyFromScene(e),this._renderer.onDestroy&&this._renderer.onDestroy()}update(e){this._renderer.ensureUpToDate()}extraInitializationFromInitialInstance(e){e.customSize&&(this.setWidth(e.width),this.setHeight(e.height))}setX(e){super.setX(e),this._renderer.updatePosition()}setY(e){super.setY(e),this._renderer.updatePosition()}setTexture(e,t){this._renderer.setTexture(e,t)}setAngle(e){super.setAngle(e),this._renderer.updateAngle()}getWidth(){return this._width}getHeight(){return this._height}setWidth(e){this._width!==e&&(this._width=e,this._renderer.updateWidth(),this.invalidateHitboxes())}setHeight(e){this._height!==e&&(this._height=e,this._renderer.updateHeight(),this.invalidateHitboxes())}setSize(e,t){this.setWidth(e),this.setHeight(t)}setOpacity(e){e<0&&(e=0),e>255&&(e=255),this.opacity=e,this._renderer.updateOpacity()}getOpacity(){return this.opacity}setColor(e){this._renderer.setColor(e)}getColor(){return this._renderer.getColor()}getScale(){const e=Math.abs(this.getScaleX()),t=Math.abs(this.getScaleY());return e===t?e:Math.sqrt(e*t)}getScaleX(){return this._width/this._renderer.getTextureWidth()}getScaleY(){return this._height/this._renderer.getTextureHeight()}setScale(e){this.setWidth(this._renderer.getTextureWidth()*e),this.setHeight(this._renderer.getTextureHeight()*e)}setScaleX(e){this.setWidth(this._renderer.getTextureWidth()*e)}setScaleY(e){this.setHeight(this._renderer.getTextureHeight()*e)}}i.PanelSpriteRuntimeObject=s,i.registerObject("PanelSpriteObject::PanelSprite",i.PanelSpriteRuntimeObject)})(gdjs||(gdjs={}));
//# sourceMappingURL=panelspriteruntimeobject.js.map
