var gdjs;(function(a){let b;(function(p){let j;(function(r){r.setCameraX=function(t,e,n,s){!t.hasLayer(n)||t.getLayer(n).setCameraX(e,s)},r.setCameraY=function(t,e,n,s){!t.hasLayer(n)||t.getLayer(n).setCameraY(e,s)},r.getCameraX=function(t,e,n){return t.hasLayer(e)?t.getLayer(e).getCameraX():0},r.getCameraY=function(t,e,n){return t.hasLayer(e)?t.getLayer(e).getCameraY():0},r.getCameraWidth=function(t,e,n){return t.hasLayer(e)?t.getLayer(e).getCameraWidth():0},r.getCameraHeight=function(t,e,n){return t.hasLayer(e)?t.getLayer(e).getCameraHeight():0},r.getCameraBorderLeft=function(t,e,n){return t.hasLayer(e)?r.getCameraX(t,e,n)-r.getCameraWidth(t,e,n)/2:0},r.getCameraBorderRight=function(t,e,n){return t.hasLayer(e)?r.getCameraX(t,e,n)+r.getCameraWidth(t,e,n)/2:0},r.getCameraBorderTop=function(t,e,n){return t.hasLayer(e)?r.getCameraY(t,e,n)-r.getCameraHeight(t,e,n)/2:0},r.getCameraBorderBottom=function(t,e,n){return t.hasLayer(e)?r.getCameraY(t,e,n)+r.getCameraHeight(t,e,n)/2:0},r.showLayer=function(t,e){if(!!t.hasLayer(e))return t.getLayer(e).show(!0)},r.hideLayer=function(t,e){if(!!t.hasLayer(e))return t.getLayer(e).show(!1)},r.layerIsVisible=function(t,e){return t.hasLayer(e)&&t.getLayer(e).isVisible()},r.setCameraRotation=function(t,e,n,s){if(!!t.hasLayer(n))return t.getLayer(n).setCameraRotation(e,s)},r.getCameraRotation=function(t,e,n){return t.hasLayer(e)?t.getLayer(e).getCameraRotation(n):0},r.getCameraZoom=function(t,e,n){return t.hasLayer(e)?t.getLayer(e).getCameraZoom(n):0},r.setCameraZoom=function(t,e,n,s){if(!!t.hasLayer(n))return t.getLayer(n).setCameraZoom(e,s)},r.centerCamera=function(t,e,n,s,o){if(!t.hasLayer(s)||e==null)return;let f=0,i=0;if(n&&!e.hasNoForces()){const u=e.getAverageForce(),L=e.getElapsedTime()/1e3;f=u.getX()*L,i=u.getY()*L}const g=t.getLayer(s);g.setCameraX(e.getCenterXInScene()+f,o),g.setCameraY(e.getCenterYInScene()+i,o)},r.centerCameraWithinLimits=function(t,e,n,s,o,f,i,g,u){r.centerCamera(t,e,i,g,u),r.clampCamera(t,n,s,o,f,g,u)},r.clampCamera=function(t,e,n,s,o,f,i){if(!t.hasLayer(f))return;const g=t.getLayer(f),u=g.getCameraWidth(i)/2,L=g.getCameraHeight(i)/2,m=e+u,c=s-u,h=n+L,d=o-L,B=m<c?a.evtTools.common.clamp(g.getCameraX(i),m,c):(m+c)/2,E=h<d?a.evtTools.common.clamp(g.getCameraY(i),h,d):(h+d)/2;g.setCameraX(B,i),g.setCameraY(E,i)},r.setLayerEffectDoubleParameter=function(t,e,n,s,o){if(!!t.hasLayer(e))return t.getLayer(e).setEffectDoubleParameter(n,s,o)},r.setLayerEffectStringParameter=function(t,e,n,s,o){if(!!t.hasLayer(e))return t.getLayer(e).setEffectStringParameter(n,s,o)},r.setLayerEffectBooleanParameter=function(t,e,n,s,o){if(!!t.hasLayer(e))return t.getLayer(e).setEffectBooleanParameter(n,s,o)},r.enableLayerEffect=function(t,e,n,s){!t.hasLayer(e)||t.getLayer(e).enableEffect(n,s)},r.layerEffectEnabled=function(t,e,n){return t.hasLayer(e)?t.getLayer(e).isEffectEnabled(n):!0},r.setLayerTimeScale=function(t,e,n){if(!!t.hasLayer(e))return t.getLayer(e).setTimeScale(n)},r.getLayerTimeScale=function(t,e){return t.hasLayer(e)?t.getLayer(e).getTimeScale():1},r.setLayerDefaultZOrder=function(t,e,n){if(!!t.hasLayer(e))return t.getLayer(e).setDefaultZOrder(n)},r.getLayerDefaultZOrder=function(t,e){return t.hasLayer(e)?t.getLayer(e).getDefaultZOrder():0},r.setLayerAmbientLightColor=function(t,e,n){if(!t.hasLayer(e)||!t.getLayer(e).isLightingLayer())return;const s=a.rgbOrHexToRGBColor(n);return t.getLayer(e).setClearColor(s[0],s[1],s[2])}})(j=p.camera||(p.camera={}))})(b=a.evtTools||(a.evtTools={}))})(gdjs||(gdjs={}));
//# sourceMappingURL=cameratools.js.map
