var gdjs;(function(i){let n;(function(t){t[t.TWO_D=0]="TWO_D",t[t.THREE_D=1]="THREE_D",t[t.TWO_D_PLUS_THREE_D=2]="TWO_D_PLUS_THREE_D"})(n=i.RuntimeLayerRenderingType||(i.RuntimeLayerRenderingType={}));const f=r=>r==="3d"?1:r==="2d+3d"||r===""?2:0;let s;(function(a){a[a.PERSPECTIVE=0]="PERSPECTIVE",a[a.ORTHOGRAPHIC=1]="ORTHOGRAPHIC"})(s=i.RuntimeLayerCameraType||(i.RuntimeLayerCameraType={}));const m=r=>r==="orthographic"?1:0;let o;(function(a){a[a.DO_NOTHING=0]="DO_NOTHING",a[a.TOP_LEFT_ANCHORED_IF_NEVER_MOVED=1]="TOP_LEFT_ANCHORED_IF_NEVER_MOVED"})(o=i.RuntimeLayerDefaultCameraBehavior||(i.RuntimeLayerDefaultCameraBehavior={}));const d=r=>r==="top-left-anchored-if-never-moved"?1:0;class c{constructor(e,a){this._timeScale=1;this._defaultZOrder=0;this._rendererEffects={};this._name=e.name,this._renderingType=f(e.renderingType),this._cameraType=m(e.cameraType),this._defaultCameraBehavior=d(e.defaultCameraBehavior||"top-left-anchored-if-never-moved"),this._hidden=!e.visibility,this._initialCamera3DFieldOfView=e.camera3DFieldOfView||45,this._initialCamera3DNearPlaneDistance=e.camera3DNearPlaneDistance||.1,this._initialCamera3DFarPlaneDistance=e.camera3DFarPlaneDistance||2e3,this._initialCamera2DPlaneMaxDrawingDistance=e.camera2DPlaneMaxDrawingDistance||5e3,this._initialLayerData=e,this._runtimeScene=a,this._effectsManager=a.getGame().getEffectsManager(),this._isLightingLayer=e.isLightingLayer,this._followBaseLayerCamera=e.followBaseLayerCamera,this._clearColor=[e.ambientLightColorR/255,e.ambientLightColorG/255,e.ambientLightColorB/255,1],this._renderer=new i.LayerRenderer(this,a.getRenderer(),a.getGame().getRenderer()),this.show(!this._hidden);for(let t=0;t=0&&(this._timeScale=e)}getTimeScale(){return this._timeScale}getElapsedTime(e){return(e||this._runtimeScene).getElapsedTime()*this._timeScale}followBaseLayer(){const e=this._runtimeScene.getLayer("");this.setCameraX(e.getCameraX()),this.setCameraY(e.getCameraY()),this.setCameraRotation(e.getCameraRotation()),this.setCameraZoom(e.getCameraZoom())}getClearColor(){return this._clearColor}setClearColor(e,a,t){this._clearColor[0]=e/255,this._clearColor[1]=a/255,this._clearColor[2]=t/255,this._renderer.updateClearColor()}setFollowBaseLayerCamera(e){this._followBaseLayerCamera=e}isLightingLayer(){return this._isLightingLayer&&!this._runtimeScene.getGame().isInGameEdition()}}i.RuntimeLayer=c})(gdjs||(gdjs={})); //# sourceMappingURL=RuntimeLayer.js.map