From 803f57690d0a62441ab639bbc709b9178c3eeff7 Mon Sep 17 00:00:00 2001 From: Scott Westover Date: Tue, 26 Mar 2024 08:20:25 -0400 Subject: [PATCH] fixed shader example Signed-off-by: Scott Westover --- .../{index-Dvgi4d_U.js => index-BgEoxzBH.js} | 22 +++++++++---------- examples/shader-examples/index.html | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) rename examples/shader-examples/assets/js/{index-Dvgi4d_U.js => index-BgEoxzBH.js} (99%) diff --git a/examples/shader-examples/assets/js/index-Dvgi4d_U.js b/examples/shader-examples/assets/js/index-BgEoxzBH.js similarity index 99% rename from examples/shader-examples/assets/js/index-Dvgi4d_U.js rename to examples/shader-examples/assets/js/index-BgEoxzBH.js index 1bb1106..a337cd8 100644 --- a/examples/shader-examples/assets/js/index-Dvgi4d_U.js +++ b/examples/shader-examples/assets/js/index-BgEoxzBH.js @@ -1,4 +1,4 @@ -var Bt=(ot,nt,ut)=>{if(!nt.has(ot))throw TypeError("Cannot "+ut)};var Dt=(ot,nt,ut)=>(Bt(ot,nt,"read from private field"),ut?ut.call(ot):nt.get(ot)),It=(ot,nt,ut)=>{if(nt.has(ot))throw TypeError("Cannot add the same private member more than once");nt instanceof WeakSet?nt.add(ot):nt.set(ot,ut)},wt=(ot,nt,ut,mt)=>(Bt(ot,nt,"write to private field"),mt?mt.call(ot,ut):nt.set(ot,ut),ut);(function(){const nt=document.createElement("link").relList;if(nt&&nt.supports&&nt.supports("modulepreload"))return;for(const ft of document.querySelectorAll('link[rel="modulepreload"]'))mt(ft);new MutationObserver(ft=>{for(const pt of ft)if(pt.type==="childList")for(const p of pt.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&mt(p)}).observe(document,{childList:!0,subtree:!0});function ut(ft){const pt={};return ft.integrity&&(pt.integrity=ft.integrity),ft.referrerPolicy&&(pt.referrerPolicy=ft.referrerPolicy),ft.crossOrigin==="use-credentials"?pt.credentials="include":ft.crossOrigin==="anonymous"?pt.credentials="omit":pt.credentials="same-origin",pt}function mt(ft){if(ft.ep)return;ft.ep=!0;const pt=ut(ft);fetch(ft.href,pt)}})();var Zt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Jt(ot){return ot&&ot.__esModule&&Object.prototype.hasOwnProperty.call(ot,"default")?ot.default:ot}var Kt={exports:{}};(function(ot,nt){(function(mt,ft){ot.exports=ft()})(Zt,()=>(()=>{var ut={50792:p=>{var S=Object.prototype.hasOwnProperty,t="~";function d(){}Object.create&&(d.prototype=Object.create(null),new d().__proto__||(t=!1));function c(e,s,h){this.fn=e,this.context=s,this.once=h||!1}function a(e,s,h,i,o){if(typeof h!="function")throw new TypeError("The listener must be a function");var f=new c(h,i||e,o),l=t?t+s:s;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],f]:e._events[l].push(f):(e._events[l]=f,e._eventsCount++),e}function r(e,s){--e._eventsCount===0?e._events=new d:delete e._events[s]}function n(){this._events=new d,this._eventsCount=0}n.prototype.eventNames=function(){var s=[],h,i;if(this._eventsCount===0)return s;for(i in h=this._events)S.call(h,i)&&s.push(t?i.slice(1):i);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(h)):s},n.prototype.listeners=function(s){var h=t?t+s:s,i=this._events[h];if(!i)return[];if(i.fn)return[i.fn];for(var o=0,f=i.length,l=new Array(f);o{/** +var Ft=(at,nt,ut)=>{if(!nt.has(at))throw TypeError("Cannot "+ut)};var Mt=(at,nt,ut)=>(Ft(at,nt,"read from private field"),ut?ut.call(at):nt.get(at)),Lt=(at,nt,ut)=>{if(nt.has(at))throw TypeError("Cannot add the same private member more than once");nt instanceof WeakSet?nt.add(at):nt.set(at,ut)},Rt=(at,nt,ut,mt)=>(Ft(at,nt,"write to private field"),mt?mt.call(at,ut):nt.set(at,ut),ut);(function(){const nt=document.createElement("link").relList;if(nt&&nt.supports&&nt.supports("modulepreload"))return;for(const ft of document.querySelectorAll('link[rel="modulepreload"]'))mt(ft);new MutationObserver(ft=>{for(const pt of ft)if(pt.type==="childList")for(const p of pt.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&mt(p)}).observe(document,{childList:!0,subtree:!0});function ut(ft){const pt={};return ft.integrity&&(pt.integrity=ft.integrity),ft.referrerPolicy&&(pt.referrerPolicy=ft.referrerPolicy),ft.crossOrigin==="use-credentials"?pt.credentials="include":ft.crossOrigin==="anonymous"?pt.credentials="omit":pt.credentials="same-origin",pt}function mt(ft){if(ft.ep)return;ft.ep=!0;const pt=ut(ft);fetch(ft.href,pt)}})();var Yt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wt(at){return at&&at.__esModule&&Object.prototype.hasOwnProperty.call(at,"default")?at.default:at}var Vt={exports:{}};(function(at,nt){(function(mt,ft){at.exports=ft()})(Yt,()=>(()=>{var ut={50792:p=>{var S=Object.prototype.hasOwnProperty,t="~";function d(){}Object.create&&(d.prototype=Object.create(null),new d().__proto__||(t=!1));function c(e,s,h){this.fn=e,this.context=s,this.once=h||!1}function a(e,s,h,i,o){if(typeof h!="function")throw new TypeError("The listener must be a function");var f=new c(h,i||e,o),l=t?t+s:s;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],f]:e._events[l].push(f):(e._events[l]=f,e._eventsCount++),e}function r(e,s){--e._eventsCount===0?e._events=new d:delete e._events[s]}function n(){this._events=new d,this._eventsCount=0}n.prototype.eventNames=function(){var s=[],h,i;if(this._eventsCount===0)return s;for(i in h=this._events)S.call(h,i)&&s.push(t?i.slice(1):i);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(h)):s},n.prototype.listeners=function(s){var h=t?t+s:s,i=this._events[h];if(!i)return[];if(i.fn)return[i.fn];for(var o=0,f=i.length,l=new Array(f);o{/** * @author samme * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1153,7 +1153,7 @@ var Bt=(ot,nt,ut)=>{if(!nt.has(ot))throw TypeError("Cannot "+ut)};var Dt=(ot,nt, * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var S=function(t,d,c,a){if(c===void 0&&(c=!1),a===void 0)return a={local:{x:0,y:0,width:0,height:0},global:{x:0,y:0,width:0,height:0},lines:{shortest:0,longest:0,lengths:null,height:0},wrappedText:"",words:[],characters:[],scaleX:0,scaleY:0},a;var r=t.text,n=r.length,e=t.maxWidth,s=t.wordWrapCharCode,h=Number.MAX_VALUE,i=Number.MAX_VALUE,o=0,f=0,l=t.fontData.chars,u=t.fontData.lineHeight,v=t.letterSpacing,g=t.lineSpacing,x=0,m=0,y=0,T=null,E=t._align,C=0,A=0,P=t.fontSize/t.fontData.size,M=P*t.scaleX,F=P*t.scaleY,L=null,D=0,I=[],U=Number.MAX_VALUE,z=0,w=0,G=0,R,O=[],B=[],N=null;if(e>0){for(R=0;Re||$>e?(W.push(H.i-1),H.cr?(W.push(H.i+H.word.length),Y=0,V=null):V=H):H.cr&&(W.push(H.i+H.word.length),Y=0,V=null)}var q=function(at,vt,ct){return at.substr(0,vt)+ct+at.substr(vt+1)};for(R=W.length-1;R>=0;R--)r=q(r,W[R],` + */var S=function(t,d,c,a){if(c===void 0&&(c=!1),a===void 0)return a={local:{x:0,y:0,width:0,height:0},global:{x:0,y:0,width:0,height:0},lines:{shortest:0,longest:0,lengths:null,height:0},wrappedText:"",words:[],characters:[],scaleX:0,scaleY:0},a;var r=t.text,n=r.length,e=t.maxWidth,s=t.wordWrapCharCode,h=Number.MAX_VALUE,i=Number.MAX_VALUE,o=0,f=0,l=t.fontData.chars,u=t.fontData.lineHeight,v=t.letterSpacing,g=t.lineSpacing,x=0,m=0,y=0,T=null,E=t._align,C=0,A=0,P=t.fontSize/t.fontData.size,M=P*t.scaleX,F=P*t.scaleY,L=null,D=0,I=[],U=Number.MAX_VALUE,z=0,w=0,G=0,R,O=[],B=[],N=null;if(e>0){for(R=0;Re||$>e?(W.push(H.i-1),H.cr?(W.push(H.i+H.word.length),Y=0,V=null):V=H):H.cr&&(W.push(H.i+H.word.length),Y=0,V=null)}var q=function(ot,vt,ct){return ot.substr(0,vt)+ct+ot.substr(vt+1)};for(R=W.length-1;R>=0;R--)r=q(r,W[R],` `);a.wrappedText=r,n=r.length,O=[],N=null}var tt=0;for(R=0;Rz&&(z=G),GC&&(h=C),i>A&&(i=A);var Q=C+T.xAdvance,k=A+u;oz&&(z=G),G0)for(var et=0;et{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. @@ -1198,7 +1198,7 @@ var Bt=(ot,nt,ut)=>{if(!nt.has(ot))throw TypeError("Cannot "+ut)};var Dt=(ot,nt, * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var d=t(91296),c=t(61340),a=t(70554),r=new c,n=function(e,s,h,i){var o=s.text,f=o.length;if(f!==0){h.addToRenderList(s);var l=e.pipelines.set(s.pipeline,s),u=d(s,h,i);e.pipelines.preBatch(s);var v=u.sprite,g=u.calc,x=r,m=s.cropWidth>0||s.cropHeight>0;m&&(l.flush(),e.pushScissor(g.tx,g.ty,s.cropWidth*g.scaleX,s.cropHeight*g.scaleY));var y=s.frame,T=y.glTexture,E=s.tintFill,C=a.getTintAppendFloatAlpha(s.tintTopLeft,h.alpha*s._alphaTL),A=a.getTintAppendFloatAlpha(s.tintTopRight,h.alpha*s._alphaTR),P=a.getTintAppendFloatAlpha(s.tintBottomLeft,h.alpha*s._alphaBL),M=a.getTintAppendFloatAlpha(s.tintBottomRight,h.alpha*s._alphaBR),F=l.setGameObject(s),L=0,D=0,I=0,U=0,z=s.letterSpacing,w,G=0,R=0,O,B=s.scrollX,N=s.scrollY,X=s.fontData,V=X.chars,Y=X.lineHeight,W=s.fontSize/X.size,H=0,b=s._align,K=0,J=0,Z=s.getTextBounds(!1);s.maxWidth>0&&(o=Z.wrappedText,f=o.length);var $=s._bounds.lines;b===1?J=($.longest-$.lengths[0])/2:b===2&&(J=$.longest-$.lengths[0]);for(var q=h.roundPixels,tt=s.displayCallback,_=s.callbackData,Q=0;Q{/** + */var d=t(91296),c=t(61340),a=t(70554),r=new c,n=function(e,s,h,i){var o=s.text,f=o.length;if(f!==0){h.addToRenderList(s);var l=e.pipelines.set(s.pipeline,s),u=d(s,h,i);e.pipelines.preBatch(s);var v=u.sprite,g=u.calc,x=r,m=s.cropWidth>0||s.cropHeight>0;m&&(l.flush(),e.pushScissor(g.tx,g.ty,s.cropWidth*g.scaleX,s.cropHeight*g.scaleY));var y=s.frame,T=y.glTexture,E=s.tintFill,C=a.getTintAppendFloatAlpha(s.tintTopLeft,h.alpha*s._alphaTL),A=a.getTintAppendFloatAlpha(s.tintTopRight,h.alpha*s._alphaTR),P=a.getTintAppendFloatAlpha(s.tintBottomLeft,h.alpha*s._alphaBL),M=a.getTintAppendFloatAlpha(s.tintBottomRight,h.alpha*s._alphaBR),F=l.setGameObject(s),L=0,D=0,I=0,U=0,z=s.letterSpacing,w,G=0,R=0,O,B=s.scrollX,N=s.scrollY,X=s.fontData,V=X.chars,Y=X.lineHeight,W=s.fontSize/X.size,H=0,b=s._align,K=0,J=0,Z=s.getTextBounds(!1);s.maxWidth>0&&(o=Z.wrappedText,f=o.length);var $=s._bounds.lines;b===1?J=($.longest-$.lengths[0])/2:b===2&&(J=$.longest-$.lengths[0]);for(var q=h.roundPixels,tt=s.displayCallback,_=s.callbackData,Q=0;Q{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -2597,7 +2597,7 @@ var Bt=(ot,nt,ut)=>{if(!nt.has(ot))throw TypeError("Cannot "+ut)};var Dt=(ot,nt, * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var d=t(83997),c=t(95540),a=t(37867),r=t(25836),n=t(39318),e=new r,s=new r,h=new a,i=function(o){var f=c(o,"mesh"),l=c(o,"texture",null),u=c(o,"frame"),v=c(o,"width",1),g=c(o,"height",v),x=c(o,"widthSegments",1),m=c(o,"heightSegments",x),y=c(o,"x",0),T=c(o,"y",0),E=c(o,"z",0),C=c(o,"rotateX",0),A=c(o,"rotateY",0),P=c(o,"rotateZ",0),M=c(o,"zIsUp",!0),F=c(o,"isOrtho",f?f.dirtyCache[11]:!1),L=c(o,"colors",[16777215]),D=c(o,"alphas",[1]),I=c(o,"tile",!1),U=c(o,"flipY",!1),z=c(o,"width",null),w={faces:[],verts:[]};e.set(y,T,E),s.set(C,A,P),h.fromRotationXYTranslation(s,e,M);var G;if(!l&&f)l=f.texture,u||(G=f.frame);else if(f&&typeof l=="string")l=f.scene.sys.textures.get(l);else if(!l)return w;G||(G=l.get(u)),!z&&F&&l&&f&&(v=G.width/f.height,g=G.height/f.height);var R=v/2,O=g/2,B=Math.floor(x),N=Math.floor(m),X=B+1,V=N+1,Y=v/B,W=g/N,H=[],b=[],K,J,Z=0,$=1,q=0,tt=1;G&&(Z=G.u0,$=G.u1,U?(q=G.v1,tt=G.v0):(q=G.v0,tt=G.v1));var _=$-Z,Q=tt-q;for(J=0;J{/** + */var d=t(83997),c=t(95540),a=t(37867),r=t(25836),n=t(39318),e=new r,s=new r,h=new a,i=function(o){var f=c(o,"mesh"),l=c(o,"texture",null),u=c(o,"frame"),v=c(o,"width",1),g=c(o,"height",v),x=c(o,"widthSegments",1),m=c(o,"heightSegments",x),y=c(o,"x",0),T=c(o,"y",0),E=c(o,"z",0),C=c(o,"rotateX",0),A=c(o,"rotateY",0),P=c(o,"rotateZ",0),M=c(o,"zIsUp",!0),F=c(o,"isOrtho",f?f.dirtyCache[11]:!1),L=c(o,"colors",[16777215]),D=c(o,"alphas",[1]),I=c(o,"tile",!1),U=c(o,"flipY",!1),z=c(o,"width",null),w={faces:[],verts:[]};e.set(y,T,E),s.set(C,A,P),h.fromRotationXYTranslation(s,e,M);var G;if(!l&&f)l=f.texture,u||(G=f.frame);else if(f&&typeof l=="string")l=f.scene.sys.textures.get(l);else if(!l)return w;G||(G=l.get(u)),!z&&F&&l&&f&&(v=G.width/f.height,g=G.height/f.height);var R=v/2,O=g/2,B=Math.floor(x),N=Math.floor(m),X=B+1,V=N+1,Y=v/B,W=g/N,H=[],b=[],K,J,Z=0,$=1,q=0,tt=1;G&&(Z=G.u0,$=G.u1,U?(q=G.v1,tt=G.v0):(q=G.v0,tt=G.v1));var _=$-Z,Q=tt-q;for(J=0;J{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -4259,7 +4259,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var d=t(55495),c=t(37742),a=t(45319),r=t(83419),n=t(79342),e=t(37747),s=t(20339),h=t(52816),i=t(50792),o=t(63012),f=t(43855),l=t(5470),u=t(94977),v=t(64897),g=t(45170),x=t(96523),m=t(35154),y=t(36383),T=t(25774),E=t(96602),C=t(87841),A=t(59542),P=t(40012),M=t(14087),F=t(89936),L=t(35072),D=t(72624),I=t(2483),U=t(61340),z=t(26099),w=t(15994),G=new r({Extends:i,initialize:function(O,B){i.call(this),this.scene=O,this.bodies=new L,this.staticBodies=new L,this.pendingDestroy=new L,this.colliders=new T,this.gravity=new z(m(B,"gravity.x",0),m(B,"gravity.y",0)),this.bounds=new C(m(B,"x",0),m(B,"y",0),m(B,"width",O.sys.scale.width),m(B,"height",O.sys.scale.height)),this.checkCollision={up:m(B,"checkCollision.up",!0),down:m(B,"checkCollision.down",!0),left:m(B,"checkCollision.left",!0),right:m(B,"checkCollision.right",!0)},this.fps=m(B,"fps",60),this.fixedStep=m(B,"fixedStep",!0),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=m(B,"timeScale",1),this.OVERLAP_BIAS=m(B,"overlapBias",4),this.TILE_BIAS=m(B,"tileBias",16),this.forceX=m(B,"forceX",!1),this.isPaused=m(B,"isPaused",!1),this._total=0,this.drawDebug=m(B,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:m(B,"debugShowBody",!0),debugShowStaticBody:m(B,"debugShowStaticBody",!0),debugShowVelocity:m(B,"debugShowVelocity",!0),bodyDebugColor:m(B,"debugBodyColor",16711935),staticBodyDebugColor:m(B,"debugStaticBodyColor",255),velocityDebugColor:m(B,"debugVelocityColor",65280)},this.maxEntries=m(B,"maxEntries",16),this.useTree=m(B,"useTree",!0),this.tree=new A(this.maxEntries),this.staticTree=new A(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new U,this._tempMatrix2=new U,this.tileFilterOptions={isColliding:!0,isNotEmpty:!0,hasInterestingFace:!0},this.drawDebug&&this.createDebugGraphic()},enable:function(R,O){O===void 0&&(O=e.DYNAMIC_BODY),Array.isArray(R)||(R=[R]);for(var B=0;B=X;for(this.fixedStep||(N=O*.001,W=!0,this._elapsed=0),B=0;B=X;)this._elapsed-=X,this.step(N)}},step:function(R){var O,B,N=this.bodies.entries,X=N.length;for(O=0;O0){var H=this.tree,b=this.staticTree;for(B=W.entries,N=B.length,R=0;R-1&&R.velocity.length()>J&&(R.velocity.normalize().scale(J),K=J),R.speed=K},separate:function(R,O,B,N,X){var V,Y,W=!1,H=!0;if(!R.enable||!O.enable||R.checkCollision.none||O.checkCollision.none||!this.intersects(R,O)||B&&B.call(N,R.gameObject,O.gameObject)===!1)return W;if(R.isCircle||O.isCircle){var b=this.separateCircle(R,O,X);b.result?(W=!0,H=!1):(V=b.x,Y=b.y,H=!0)}if(H){var K=!1,J=!1,Z=this.OVERLAP_BIAS;X?(K=M(R,O,X,Z,V),J=F(R,O,X,Z,Y)):this.forceX||Math.abs(this.gravity.y+R.gravity.y)k&&(J=s($,q,k,Q)-tt):q>j&&($<_?J=s($,q,_,j)-tt:$>k&&(J=s($,q,k,j)-tt)),J*=-1}else J=R.halfWidth+O.halfWidth-h(V,Y);R.overlapR=J,O.overlapR=J;var et=d(V,Y),it=(J+y.EPSILON)*Math.cos(et),lt=(J+y.EPSILON)*Math.sin(et),ht={overlap:J,result:!1,x:it,y:lt};if(B&&(!Z||Z&&J!==0))return ht.result=!0,ht;if(!Z&&J===0||W&&H||R.customSeparateX||O.customSeparateX)return ht.x=void 0,ht.y=void 0,ht;var rt=!R.pushable&&!O.pushable;if(Z){var st=V.x-Y.x,dt=V.y-Y.y,at=Math.sqrt(Math.pow(st,2)+Math.pow(dt,2)),vt=(Y.x-V.x)/at||0,ct=(Y.y-V.y)/at||0,gt=2*(b.x*vt+b.y*ct-K.x*vt-K.y*ct)/(R.mass+O.mass);(W||H)&&(gt*=2),W||(b.x=b.x-gt/R.mass*vt,b.y=b.y-gt/R.mass*ct,b.multiply(R.bounce)),H||(K.x=K.x+gt/O.mass*vt,K.y=K.y+gt/O.mass*ct,K.multiply(O.bounce)),!W&&!H&&(it*=.5,lt*=.5),W||(R.x-=it,R.y-=lt,R.updateCenter()),H||(O.x+=it,O.y+=lt,O.updateCenter()),ht.result=!0}else!W||R.pushable||rt?(R.x-=it,R.y-=lt,R.updateCenter()):(!H||O.pushable||rt)&&(O.x+=it,O.y+=lt,O.updateCenter()),ht.x=void 0,ht.y=void 0;return ht},intersects:function(R,O){return R===O?!1:!R.isCircle&&!O.isCircle?!(R.right<=O.left||R.bottom<=O.top||R.left>=O.right||R.top>=O.bottom):R.isCircle?O.isCircle?h(R.center,O.center)<=R.halfWidth+O.halfWidth:this.circleBodyIntersects(R,O):this.circleBodyIntersects(O,R)},circleBodyIntersects:function(R,O){var B=a(R.center.x,O.left,O.right),N=a(R.center.y,O.top,O.bottom),X=(R.center.x-B)*(R.center.x-B),V=(R.center.y-N)*(R.center.y-N);return X+V<=R.halfWidth*R.halfWidth},overlap:function(R,O,B,N,X){return B===void 0&&(B=null),N===void 0&&(N=null),X===void 0&&(X=B),this.collideObjects(R,O,B,N,X,!0)},collide:function(R,O,B,N,X){return B===void 0&&(B=null),N===void 0&&(N=null),X===void 0&&(X=B),this.collideObjects(R,O,B,N,X,!1)},collideObjects:function(R,O,B,N,X,V){var Y,W;R.isParent&&(R.physicsType===void 0||O===void 0||R===O)&&(R=R.children.entries),O&&O.isParent&&O.physicsType===void 0&&(O=O.children.entries);var H=Array.isArray(R),b=Array.isArray(O);if(this._total=0,!H&&!b)this.collideHandler(R,O,B,N,X,V);else if(!H&&b)for(Y=0;Y0},collideHandler:function(R,O,B,N,X,V){if(O===void 0&&R.isParent)return this.collideGroupVsGroup(R,R,B,N,X,V);if(!R||!O)return!1;if(R.body||R.isBody){if(O.body||O.isBody)return this.collideSpriteVsSprite(R,O,B,N,X,V);if(O.isParent)return this.collideSpriteVsGroup(R,O,B,N,X,V);if(O.isTilemap)return this.collideSpriteVsTilemapLayer(R,O,B,N,X,V)}else if(R.isParent){if(O.body||O.isBody)return this.collideSpriteVsGroup(O,R,B,N,X,V);if(O.isParent)return this.collideGroupVsGroup(R,O,B,N,X,V);if(O.isTilemap)return this.collideGroupVsTilemapLayer(R,O,B,N,X,V)}else if(R.isTilemap){if(O.body||O.isBody)return this.collideSpriteVsTilemapLayer(O,R,B,N,X,V);if(O.isParent)return this.collideGroupVsTilemapLayer(O,R,B,N,X,V)}},canCollide:function(R,O){return R&&O&&(R.collisionMask&O.collisionCategory)!==0&&(O.collisionMask&R.collisionCategory)!==0},collideSpriteVsSprite:function(R,O,B,N,X,V){var Y=R.isBody?R:R.body,W=O.isBody?O:O.body;return this.canCollide(Y,W)?(this.separate(Y,W,N,X,V)&&(B&&B.call(X,R,O),this._total++),!0):!1},collideSpriteVsGroup:function(R,O,B,N,X,V){var Y=R.isBody?R:R.body;if(!(O.length===0||!Y||!Y.enable||Y.checkCollision.none||!this.canCollide(Y,O))){var W,H,b;if(this.useTree||O.physicsType===e.STATIC_BODY){var K=this.treeMinMax;K.minX=Y.left,K.minY=Y.top,K.maxX=Y.right,K.maxY=Y.bottom;var J=O.physicsType===e.DYNAMIC_BODY?this.tree.search(K):this.staticTree.search(K);for(H=J.length,W=0;W{/** + */var d=t(55495),c=t(37742),a=t(45319),r=t(83419),n=t(79342),e=t(37747),s=t(20339),h=t(52816),i=t(50792),o=t(63012),f=t(43855),l=t(5470),u=t(94977),v=t(64897),g=t(45170),x=t(96523),m=t(35154),y=t(36383),T=t(25774),E=t(96602),C=t(87841),A=t(59542),P=t(40012),M=t(14087),F=t(89936),L=t(35072),D=t(72624),I=t(2483),U=t(61340),z=t(26099),w=t(15994),G=new r({Extends:i,initialize:function(O,B){i.call(this),this.scene=O,this.bodies=new L,this.staticBodies=new L,this.pendingDestroy=new L,this.colliders=new T,this.gravity=new z(m(B,"gravity.x",0),m(B,"gravity.y",0)),this.bounds=new C(m(B,"x",0),m(B,"y",0),m(B,"width",O.sys.scale.width),m(B,"height",O.sys.scale.height)),this.checkCollision={up:m(B,"checkCollision.up",!0),down:m(B,"checkCollision.down",!0),left:m(B,"checkCollision.left",!0),right:m(B,"checkCollision.right",!0)},this.fps=m(B,"fps",60),this.fixedStep=m(B,"fixedStep",!0),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=m(B,"timeScale",1),this.OVERLAP_BIAS=m(B,"overlapBias",4),this.TILE_BIAS=m(B,"tileBias",16),this.forceX=m(B,"forceX",!1),this.isPaused=m(B,"isPaused",!1),this._total=0,this.drawDebug=m(B,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:m(B,"debugShowBody",!0),debugShowStaticBody:m(B,"debugShowStaticBody",!0),debugShowVelocity:m(B,"debugShowVelocity",!0),bodyDebugColor:m(B,"debugBodyColor",16711935),staticBodyDebugColor:m(B,"debugStaticBodyColor",255),velocityDebugColor:m(B,"debugVelocityColor",65280)},this.maxEntries=m(B,"maxEntries",16),this.useTree=m(B,"useTree",!0),this.tree=new A(this.maxEntries),this.staticTree=new A(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new U,this._tempMatrix2=new U,this.tileFilterOptions={isColliding:!0,isNotEmpty:!0,hasInterestingFace:!0},this.drawDebug&&this.createDebugGraphic()},enable:function(R,O){O===void 0&&(O=e.DYNAMIC_BODY),Array.isArray(R)||(R=[R]);for(var B=0;B=X;for(this.fixedStep||(N=O*.001,W=!0,this._elapsed=0),B=0;B=X;)this._elapsed-=X,this.step(N)}},step:function(R){var O,B,N=this.bodies.entries,X=N.length;for(O=0;O0){var H=this.tree,b=this.staticTree;for(B=W.entries,N=B.length,R=0;R-1&&R.velocity.length()>J&&(R.velocity.normalize().scale(J),K=J),R.speed=K},separate:function(R,O,B,N,X){var V,Y,W=!1,H=!0;if(!R.enable||!O.enable||R.checkCollision.none||O.checkCollision.none||!this.intersects(R,O)||B&&B.call(N,R.gameObject,O.gameObject)===!1)return W;if(R.isCircle||O.isCircle){var b=this.separateCircle(R,O,X);b.result?(W=!0,H=!1):(V=b.x,Y=b.y,H=!0)}if(H){var K=!1,J=!1,Z=this.OVERLAP_BIAS;X?(K=M(R,O,X,Z,V),J=F(R,O,X,Z,Y)):this.forceX||Math.abs(this.gravity.y+R.gravity.y)k&&(J=s($,q,k,Q)-tt):q>j&&($<_?J=s($,q,_,j)-tt:$>k&&(J=s($,q,k,j)-tt)),J*=-1}else J=R.halfWidth+O.halfWidth-h(V,Y);R.overlapR=J,O.overlapR=J;var et=d(V,Y),it=(J+y.EPSILON)*Math.cos(et),lt=(J+y.EPSILON)*Math.sin(et),ht={overlap:J,result:!1,x:it,y:lt};if(B&&(!Z||Z&&J!==0))return ht.result=!0,ht;if(!Z&&J===0||W&&H||R.customSeparateX||O.customSeparateX)return ht.x=void 0,ht.y=void 0,ht;var rt=!R.pushable&&!O.pushable;if(Z){var st=V.x-Y.x,dt=V.y-Y.y,ot=Math.sqrt(Math.pow(st,2)+Math.pow(dt,2)),vt=(Y.x-V.x)/ot||0,ct=(Y.y-V.y)/ot||0,gt=2*(b.x*vt+b.y*ct-K.x*vt-K.y*ct)/(R.mass+O.mass);(W||H)&&(gt*=2),W||(b.x=b.x-gt/R.mass*vt,b.y=b.y-gt/R.mass*ct,b.multiply(R.bounce)),H||(K.x=K.x+gt/O.mass*vt,K.y=K.y+gt/O.mass*ct,K.multiply(O.bounce)),!W&&!H&&(it*=.5,lt*=.5),W||(R.x-=it,R.y-=lt,R.updateCenter()),H||(O.x+=it,O.y+=lt,O.updateCenter()),ht.result=!0}else!W||R.pushable||rt?(R.x-=it,R.y-=lt,R.updateCenter()):(!H||O.pushable||rt)&&(O.x+=it,O.y+=lt,O.updateCenter()),ht.x=void 0,ht.y=void 0;return ht},intersects:function(R,O){return R===O?!1:!R.isCircle&&!O.isCircle?!(R.right<=O.left||R.bottom<=O.top||R.left>=O.right||R.top>=O.bottom):R.isCircle?O.isCircle?h(R.center,O.center)<=R.halfWidth+O.halfWidth:this.circleBodyIntersects(R,O):this.circleBodyIntersects(O,R)},circleBodyIntersects:function(R,O){var B=a(R.center.x,O.left,O.right),N=a(R.center.y,O.top,O.bottom),X=(R.center.x-B)*(R.center.x-B),V=(R.center.y-N)*(R.center.y-N);return X+V<=R.halfWidth*R.halfWidth},overlap:function(R,O,B,N,X){return B===void 0&&(B=null),N===void 0&&(N=null),X===void 0&&(X=B),this.collideObjects(R,O,B,N,X,!0)},collide:function(R,O,B,N,X){return B===void 0&&(B=null),N===void 0&&(N=null),X===void 0&&(X=B),this.collideObjects(R,O,B,N,X,!1)},collideObjects:function(R,O,B,N,X,V){var Y,W;R.isParent&&(R.physicsType===void 0||O===void 0||R===O)&&(R=R.children.entries),O&&O.isParent&&O.physicsType===void 0&&(O=O.children.entries);var H=Array.isArray(R),b=Array.isArray(O);if(this._total=0,!H&&!b)this.collideHandler(R,O,B,N,X,V);else if(!H&&b)for(Y=0;Y0},collideHandler:function(R,O,B,N,X,V){if(O===void 0&&R.isParent)return this.collideGroupVsGroup(R,R,B,N,X,V);if(!R||!O)return!1;if(R.body||R.isBody){if(O.body||O.isBody)return this.collideSpriteVsSprite(R,O,B,N,X,V);if(O.isParent)return this.collideSpriteVsGroup(R,O,B,N,X,V);if(O.isTilemap)return this.collideSpriteVsTilemapLayer(R,O,B,N,X,V)}else if(R.isParent){if(O.body||O.isBody)return this.collideSpriteVsGroup(O,R,B,N,X,V);if(O.isParent)return this.collideGroupVsGroup(R,O,B,N,X,V);if(O.isTilemap)return this.collideGroupVsTilemapLayer(R,O,B,N,X,V)}else if(R.isTilemap){if(O.body||O.isBody)return this.collideSpriteVsTilemapLayer(O,R,B,N,X,V);if(O.isParent)return this.collideGroupVsTilemapLayer(O,R,B,N,X,V)}},canCollide:function(R,O){return R&&O&&(R.collisionMask&O.collisionCategory)!==0&&(O.collisionMask&R.collisionCategory)!==0},collideSpriteVsSprite:function(R,O,B,N,X,V){var Y=R.isBody?R:R.body,W=O.isBody?O:O.body;return this.canCollide(Y,W)?(this.separate(Y,W,N,X,V)&&(B&&B.call(X,R,O),this._total++),!0):!1},collideSpriteVsGroup:function(R,O,B,N,X,V){var Y=R.isBody?R:R.body;if(!(O.length===0||!Y||!Y.enable||Y.checkCollision.none||!this.canCollide(Y,O))){var W,H,b;if(this.useTree||O.physicsType===e.STATIC_BODY){var K=this.treeMinMax;K.minX=Y.left,K.minY=Y.top,K.maxX=Y.right,K.maxY=Y.bottom;var J=O.physicsType===e.DYNAMIC_BODY?this.tree.search(K):this.staticTree.search(K);for(H=J.length,W=0;W{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -4736,7 +4736,7 @@ return new `+this.key+`(); * @author Felipe Alfonso <@bitnenfer> * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var d=t(83419),c=t(94811),a=t(95540),r=t(98840),n=t(44667),e=t(61340),s=t(70554),h=t(14500),i=t(29100),o=new d({Extends:i,initialize:function(l){var u=l.game.renderer,v=a(l,"fragShader",r);l.fragShader=s.parseFragmentShaderMaxTextures(v,u.maxTextures),l.vertShader=a(l,"vertShader",n),l.attributes=a(l,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:h.UNSIGNED_BYTE,normalized:!0}]),l.resizeUniform="uResolution",i.call(this,l),this._tempMatrix1=new e,this._tempMatrix2=new e,this._tempMatrix3=new e,this.calcMatrix=new e,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[]},boot:function(){i.prototype.boot.call(this);var f=this.renderer;this.set1iv("uMainSampler",f.textureIndexes),this.set2f("uResolution",f.width,f.height),this.set1i("uRoundPixels",f.config.roundPixels)},batchSprite:function(f,l,u){this.manager.set(this,f);var v=this._tempMatrix1,g=this._tempMatrix2,x=this._tempMatrix3,m=f.frame,y=m.glTexture,T=m.u0,E=m.v0,C=m.u1,A=m.v1,P=m.x,M=m.y,F=m.cutWidth,L=m.cutHeight,D=m.customPivot,I=f.displayOriginX,U=f.displayOriginY,z=-I+P,w=-U+M;if(f.isCropped){var G=f._crop;(G.flipX!==f.flipX||G.flipY!==f.flipY)&&m.updateCropUVs(G,f.flipX,f.flipY),T=G.u0,E=G.v0,C=G.u1,A=G.v1,F=G.width,L=G.height,P=G.x,M=G.y,z=-I+P,w=-U+M}var R=1,O=1;f.flipX&&(D||(z+=-m.realWidth+I*2),R=-1),(f.flipY||m.source.isGLTexture&&m.source.isRenderTexture&&!y.flipY)&&(D||(w+=-m.realHeight+U*2),O=-1);var B=f.x,N=f.y;g.applyITRS(B,N,f.rotation,f.scaleX*R,f.scaleY*O),v.copyFrom(l.matrix),u?(v.multiplyWithOffset(u,-l.scrollX*f.scrollFactorX,-l.scrollY*f.scrollFactorY),g.e=B,g.f=N):(g.e-=l.scrollX*f.scrollFactorX,g.f-=l.scrollY*f.scrollFactorY),v.multiply(g,x);var X=x.setQuad(z,w,z+F,w+L),V=s.getTintAppendFloatAlpha,Y=l.alpha,W=V(f.tintTopLeft,Y*f._alphaTL),H=V(f.tintTopRight,Y*f._alphaTR),b=V(f.tintBottomLeft,Y*f._alphaBL),K=V(f.tintBottomRight,Y*f._alphaBR);this.shouldFlush(6)&&this.flush();var J=this.setGameObject(f,m);this.manager.preBatch(f),this.currentShader.set1i("uRoundPixels",l.roundPixels),this.batchQuad(f,X[0],X[1],X[2],X[3],X[4],X[5],X[6],X[7],T,E,C,A,W,H,b,K,f.tintFill,y,J),this.manager.postBatch(f)},batchTexture:function(f,l,u,v,g,x,m,y,T,E,C,A,P,M,F,L,D,I,U,z,w,G,R,O,B,N,X,V,Y,W,H,b,K){K===void 0&&(K=!1),this.manager.set(this,f);var J=this._tempMatrix1,Z=this._tempMatrix2,$=this._tempMatrix3,q=I/u+X,tt=U/v+V,_=(I+z)/u+X,Q=(U+w)/v+V,k=m,j=y,et=-L,it=-D;if(f.isCropped){var lt=f._crop,ht=lt.width,rt=lt.height;k=ht,j=rt,m=ht,y=rt,I=lt.x,U=lt.y;var st=I,dt=U;A&&(st=z-lt.x-ht),P&&(dt=w-lt.y-rt),q=st/u+X,tt=dt/v+V,_=(st+ht)/u+X,Q=(dt+rt)/v+V,et=-L+I,it=-D+U}P=P^(!H&&l.isRenderTexture?1:0),A&&(k*=-1,et+=m),P&&(j*=-1,it+=y),Z.applyITRS(g,x,C,T,E),J.copyFrom(Y.matrix),W?(J.multiplyWithOffset(W,-Y.scrollX*M,-Y.scrollY*F),Z.e=g,Z.f=x):(Z.e-=Y.scrollX*M,Z.f-=Y.scrollY*F),J.multiply(Z,$);var at=$.setQuad(et,it,et+k,it+j);b==null&&(b=this.setTexture2D(l)),f&&!K&&this.manager.preBatch(f),this.currentShader.set1i("uRoundPixels",Y.roundPixels),this.batchQuad(f,at[0],at[1],at[2],at[3],at[4],at[5],at[6],at[7],q,tt,_,Q,G,R,O,B,N,l,b),f&&!K&&this.manager.postBatch(f)},batchTextureFrame:function(f,l,u,v,g,x,m){this.manager.set(this);var y=this._tempMatrix1.copyFrom(x),T=this._tempMatrix2;m?y.multiply(m,T):T=y;var E=T.setQuad(l,u,l+f.width,u+f.height),C=this.setTexture2D(f.source.glTexture);v=s.getTintAppendFloatAlpha(v,g),this.batchQuad(null,E[0],E[1],E[2],E[3],E[4],E[5],E[6],E[7],f.u0,f.v0,f.u1,f.v1,v,v,v,v,0,f.glTexture,C)},batchFillRect:function(f,l,u,v,g,x){this.renderer.pipelines.set(this);var m=this.calcMatrix;x&&x.multiply(g,m);var y=m.setQuad(f,l,f+u,l+v),T=this.fillTint;this.batchQuad(null,y[0],y[1],y[2],y[3],y[4],y[5],y[6],y[7],0,0,1,1,T.TL,T.TR,T.BL,T.BR,2)},batchFillTriangle:function(f,l,u,v,g,x,m,y){this.renderer.pipelines.set(this);var T=this.calcMatrix;y&&y.multiply(m,T);var E=T.getX(f,l),C=T.getY(f,l),A=T.getX(u,v),P=T.getY(u,v),M=T.getX(g,x),F=T.getY(g,x),L=this.fillTint;this.currentShader.set1i("uRoundPixels",!1),this.batchTri(null,E,C,A,P,M,F,0,0,1,1,L.TL,L.TR,L.BL,2)},batchStrokeTriangle:function(f,l,u,v,g,x,m,y,T){var E=this.tempTriangle;E[0].x=f,E[0].y=l,E[0].width=m,E[1].x=u,E[1].y=v,E[1].width=m,E[2].x=g,E[2].y=x,E[2].width=m,E[3].x=f,E[3].y=l,E[3].width=m,this.batchStrokePath(E,m,!1,y,T)},batchFillPath:function(f,l,u){this.renderer.pipelines.set(this);var v=this.calcMatrix;u&&u.multiply(l,v);for(var g=f.length,x=this.polygonCache,m,y,T=this.fillTint.TL,E=this.fillTint.TR,C=this.fillTint.BL,A=0;A0&&k[4]?this.batchQuad(null,J,Z,W,H,k[0],k[1],k[2],k[3],0,0,1,1,q,tt,_,Q,2):(j[0]=J,j[1]=Z,j[2]=W,j[3]=H,j[4]=1),T&&j[4]?this.batchQuad(null,V,Y,b,K,j[0],j[1],j[2],j[3],0,0,1,1,q,tt,_,Q,2):(k[0]=V,k[1]=Y,k[2]=b,k[3]=K,k[4]=1)}}},destroy:function(){return this._tempMatrix1.destroy(),this._tempMatrix2.destroy(),this._tempMatrix3.destroy(),this._tempMatrix1=null,this._tempMatrix1=null,this._tempMatrix1=null,i.prototype.destroy.call(this),this}});p.exports=o},43439:(p,S,t)=>{/** + */var d=t(83419),c=t(94811),a=t(95540),r=t(98840),n=t(44667),e=t(61340),s=t(70554),h=t(14500),i=t(29100),o=new d({Extends:i,initialize:function(l){var u=l.game.renderer,v=a(l,"fragShader",r);l.fragShader=s.parseFragmentShaderMaxTextures(v,u.maxTextures),l.vertShader=a(l,"vertShader",n),l.attributes=a(l,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:h.UNSIGNED_BYTE,normalized:!0}]),l.resizeUniform="uResolution",i.call(this,l),this._tempMatrix1=new e,this._tempMatrix2=new e,this._tempMatrix3=new e,this.calcMatrix=new e,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[]},boot:function(){i.prototype.boot.call(this);var f=this.renderer;this.set1iv("uMainSampler",f.textureIndexes),this.set2f("uResolution",f.width,f.height),this.set1i("uRoundPixels",f.config.roundPixels)},batchSprite:function(f,l,u){this.manager.set(this,f);var v=this._tempMatrix1,g=this._tempMatrix2,x=this._tempMatrix3,m=f.frame,y=m.glTexture,T=m.u0,E=m.v0,C=m.u1,A=m.v1,P=m.x,M=m.y,F=m.cutWidth,L=m.cutHeight,D=m.customPivot,I=f.displayOriginX,U=f.displayOriginY,z=-I+P,w=-U+M;if(f.isCropped){var G=f._crop;(G.flipX!==f.flipX||G.flipY!==f.flipY)&&m.updateCropUVs(G,f.flipX,f.flipY),T=G.u0,E=G.v0,C=G.u1,A=G.v1,F=G.width,L=G.height,P=G.x,M=G.y,z=-I+P,w=-U+M}var R=1,O=1;f.flipX&&(D||(z+=-m.realWidth+I*2),R=-1),(f.flipY||m.source.isGLTexture&&m.source.isRenderTexture&&!y.flipY)&&(D||(w+=-m.realHeight+U*2),O=-1);var B=f.x,N=f.y;g.applyITRS(B,N,f.rotation,f.scaleX*R,f.scaleY*O),v.copyFrom(l.matrix),u?(v.multiplyWithOffset(u,-l.scrollX*f.scrollFactorX,-l.scrollY*f.scrollFactorY),g.e=B,g.f=N):(g.e-=l.scrollX*f.scrollFactorX,g.f-=l.scrollY*f.scrollFactorY),v.multiply(g,x);var X=x.setQuad(z,w,z+F,w+L),V=s.getTintAppendFloatAlpha,Y=l.alpha,W=V(f.tintTopLeft,Y*f._alphaTL),H=V(f.tintTopRight,Y*f._alphaTR),b=V(f.tintBottomLeft,Y*f._alphaBL),K=V(f.tintBottomRight,Y*f._alphaBR);this.shouldFlush(6)&&this.flush();var J=this.setGameObject(f,m);this.manager.preBatch(f),this.currentShader.set1i("uRoundPixels",l.roundPixels),this.batchQuad(f,X[0],X[1],X[2],X[3],X[4],X[5],X[6],X[7],T,E,C,A,W,H,b,K,f.tintFill,y,J),this.manager.postBatch(f)},batchTexture:function(f,l,u,v,g,x,m,y,T,E,C,A,P,M,F,L,D,I,U,z,w,G,R,O,B,N,X,V,Y,W,H,b,K){K===void 0&&(K=!1),this.manager.set(this,f);var J=this._tempMatrix1,Z=this._tempMatrix2,$=this._tempMatrix3,q=I/u+X,tt=U/v+V,_=(I+z)/u+X,Q=(U+w)/v+V,k=m,j=y,et=-L,it=-D;if(f.isCropped){var lt=f._crop,ht=lt.width,rt=lt.height;k=ht,j=rt,m=ht,y=rt,I=lt.x,U=lt.y;var st=I,dt=U;A&&(st=z-lt.x-ht),P&&(dt=w-lt.y-rt),q=st/u+X,tt=dt/v+V,_=(st+ht)/u+X,Q=(dt+rt)/v+V,et=-L+I,it=-D+U}P=P^(!H&&l.isRenderTexture?1:0),A&&(k*=-1,et+=m),P&&(j*=-1,it+=y),Z.applyITRS(g,x,C,T,E),J.copyFrom(Y.matrix),W?(J.multiplyWithOffset(W,-Y.scrollX*M,-Y.scrollY*F),Z.e=g,Z.f=x):(Z.e-=Y.scrollX*M,Z.f-=Y.scrollY*F),J.multiply(Z,$);var ot=$.setQuad(et,it,et+k,it+j);b==null&&(b=this.setTexture2D(l)),f&&!K&&this.manager.preBatch(f),this.currentShader.set1i("uRoundPixels",Y.roundPixels),this.batchQuad(f,ot[0],ot[1],ot[2],ot[3],ot[4],ot[5],ot[6],ot[7],q,tt,_,Q,G,R,O,B,N,l,b),f&&!K&&this.manager.postBatch(f)},batchTextureFrame:function(f,l,u,v,g,x,m){this.manager.set(this);var y=this._tempMatrix1.copyFrom(x),T=this._tempMatrix2;m?y.multiply(m,T):T=y;var E=T.setQuad(l,u,l+f.width,u+f.height),C=this.setTexture2D(f.source.glTexture);v=s.getTintAppendFloatAlpha(v,g),this.batchQuad(null,E[0],E[1],E[2],E[3],E[4],E[5],E[6],E[7],f.u0,f.v0,f.u1,f.v1,v,v,v,v,0,f.glTexture,C)},batchFillRect:function(f,l,u,v,g,x){this.renderer.pipelines.set(this);var m=this.calcMatrix;x&&x.multiply(g,m);var y=m.setQuad(f,l,f+u,l+v),T=this.fillTint;this.batchQuad(null,y[0],y[1],y[2],y[3],y[4],y[5],y[6],y[7],0,0,1,1,T.TL,T.TR,T.BL,T.BR,2)},batchFillTriangle:function(f,l,u,v,g,x,m,y){this.renderer.pipelines.set(this);var T=this.calcMatrix;y&&y.multiply(m,T);var E=T.getX(f,l),C=T.getY(f,l),A=T.getX(u,v),P=T.getY(u,v),M=T.getX(g,x),F=T.getY(g,x),L=this.fillTint;this.currentShader.set1i("uRoundPixels",!1),this.batchTri(null,E,C,A,P,M,F,0,0,1,1,L.TL,L.TR,L.BL,2)},batchStrokeTriangle:function(f,l,u,v,g,x,m,y,T){var E=this.tempTriangle;E[0].x=f,E[0].y=l,E[0].width=m,E[1].x=u,E[1].y=v,E[1].width=m,E[2].x=g,E[2].y=x,E[2].width=m,E[3].x=f,E[3].y=l,E[3].width=m,this.batchStrokePath(E,m,!1,y,T)},batchFillPath:function(f,l,u){this.renderer.pipelines.set(this);var v=this.calcMatrix;u&&u.multiply(l,v);for(var g=f.length,x=this.polygonCache,m,y,T=this.fillTint.TL,E=this.fillTint.TR,C=this.fillTint.BL,A=0;A0&&k[4]?this.batchQuad(null,J,Z,W,H,k[0],k[1],k[2],k[3],0,0,1,1,q,tt,_,Q,2):(j[0]=J,j[1]=Z,j[2]=W,j[3]=H,j[4]=1),T&&j[4]?this.batchQuad(null,V,Y,b,K,j[0],j[1],j[2],j[3],0,0,1,1,q,tt,_,Q,2):(k[0]=V,k[1]=Y,k[2]=b,k[3]=K,k[4]=1)}}},destroy:function(){return this._tempMatrix1.destroy(),this._tempMatrix2.destroy(),this._tempMatrix3.destroy(),this._tempMatrix1=null,this._tempMatrix1=null,this._tempMatrix1=null,i.prototype.destroy.call(this),this}});p.exports=o},43439:(p,S,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -6342,7 +6342,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */p.exports={Format:t(27902),Pad:t(41836),RemoveAt:t(33628),Reverse:t(27671),UppercaseFirst:t(35355),UUID:t(45650)}}},mt={};function ft(p){var S=mt[p];if(S!==void 0)return S.exports;var t=mt[p]={exports:{}};return ut[p](t,t.exports,ft),t.exports}ft.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}();var pt=ft(85454);return pt})())})(Kt);var Qt=Kt.exports;const xt=Jt(Qt),$t=` + */p.exports={Format:t(27902),Pad:t(41836),RemoveAt:t(33628),Reverse:t(27671),UppercaseFirst:t(35355),UUID:t(45650)}}},mt={};function ft(p){var S=mt[p];if(S!==void 0)return S.exports;var t=mt[p]={exports:{}};return ut[p](t,t.exports,ft),t.exports}ft.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}();var pt=ft(85454);return pt})())})(Vt);var Ht=Vt.exports;const xt=Wt(Ht),bt=` #define SHADER_NAME NOTHING_POST_TINT #ifdef GL_ES @@ -6356,7 +6356,7 @@ uniform sampler2D uMainSampler; void main() { gl_FragColor = texture2D(uMainSampler, outTexCoord); } -`;class Gt extends Phaser.Renderer.WebGL.Pipelines.PostFXPipeline{constructor(nt){super({game:nt,fragShader:$t})}}const Nt="BG";class Mt extends xt.Scene{constructor(){super({key:Mt.name})}preload(){this.load.image(Nt,"assets/images/bg.png")}create(){var nt;this.add.image(0,0,Nt).setOrigin(0),this.renderer.pipelines.addPostPipeline("NothingPostFxPipeline",Gt),this.cameras.main.setPostPipeline(Gt),(nt=this.input.keyboard)==null||nt.once("keydown-SPACE",()=>{this.scene.start("ColorPostFxScene")})}}const jt=` +`;class Ot extends Phaser.Renderer.WebGL.Pipelines.PostFXPipeline{constructor(nt){super({game:nt,fragShader:bt})}}const Dt="BG";class Kt extends xt.Scene{constructor(){super({key:"NothingPostFxScene"})}preload(){this.load.image(Dt,"assets/images/bg.png")}create(){var nt;this.add.image(0,0,Dt).setOrigin(0),this.renderer.pipelines.addPostPipeline("NothingPostFxPipeline",Ot),this.cameras.main.setPostPipeline(Ot),(nt=this.input.keyboard)==null||nt.once("keydown-SPACE",()=>{this.scene.start("ColorPostFxScene")})}}const Zt=` #define SHADER_NAME COLOR_POST_TINT #ifdef GL_ES @@ -6367,7 +6367,7 @@ void main() { // RGB, Alpha gl_FragColor = vec4(0.0, 0.0, 0.0, 0.2); } -`;class Ut extends Phaser.Renderer.WebGL.Pipelines.PostFXPipeline{constructor(nt){super({game:nt,fragShader:jt})}}const Xt="BG";class Rt extends xt.Scene{constructor(){super({key:Rt.name})}preload(){this.load.image(Xt,"assets/images/bg.png")}create(){var nt;this.add.image(0,0,Xt).setOrigin(0),this.renderer.pipelines.addPostPipeline("ColorPostFxPipeline",Ut),this.cameras.main.setPostPipeline(Ut),(nt=this.input.keyboard)==null||nt.once("keydown-SPACE",()=>{this.scene.start("GreyScalePostFxScene")})}}const kt=` +`;class wt extends Phaser.Renderer.WebGL.Pipelines.PostFXPipeline{constructor(nt){super({game:nt,fragShader:Zt})}}const Bt="BG";class Jt extends xt.Scene{constructor(){super({key:"ColorPostFxScene"})}preload(){this.load.image(Bt,"assets/images/bg.png")}create(){var nt;this.add.image(0,0,Bt).setOrigin(0),this.renderer.pipelines.addPostPipeline("ColorPostFxPipeline",wt),this.cameras.main.setPostPipeline(wt),(nt=this.input.keyboard)==null||nt.once("keydown-SPACE",()=>{this.scene.start("GreyScalePostFxScene")})}}const Qt=` #define SHADER_NAME GREY_SCALE_POST_TINT #ifdef GL_ES @@ -6383,7 +6383,7 @@ void main() { // mix https://thebookofshaders.com/glossary/?search=mix gl_FragColor.rgb = mix(gl_FragColor.rgb, vec3(0.2126 * gl_FragColor.r + 0.7152 * gl_FragColor.g + 0.0722 * gl_FragColor.b), 1.0); } -`;class zt extends Phaser.Renderer.WebGL.Pipelines.PostFXPipeline{constructor(nt){super({game:nt,fragShader:kt})}}const Vt="BG";class Ft extends xt.Scene{constructor(){super({key:Ft.name})}preload(){this.load.image(Vt,"assets/images/bg.png")}create(){var nt;this.add.image(0,0,Vt).setOrigin(0),this.renderer.pipelines.addPostPipeline("GreyScalePostFxPipeline",zt),this.cameras.main.setPostPipeline(zt),(nt=this.input.keyboard)==null||nt.once("keydown-SPACE",()=>{this.scene.start("WipePostFxScene")})}}const qt=` +`;class It extends Phaser.Renderer.WebGL.Pipelines.PostFXPipeline{constructor(nt){super({game:nt,fragShader:Qt})}}const Gt="BG";class $t extends xt.Scene{constructor(){super({key:"GreyScalePostFxScene"})}preload(){this.load.image(Gt,"assets/images/bg.png")}create(){var nt;this.add.image(0,0,Gt).setOrigin(0),this.renderer.pipelines.addPostPipeline("GreyScalePostFxPipeline",It),this.cameras.main.setPostPipeline(It),(nt=this.input.keyboard)==null||nt.once("keydown-SPACE",()=>{this.scene.start("WipePostFxScene")})}}const jt=` #define SHADER_NAME WIPE_POST_FX #ifdef GL_ES @@ -6403,4 +6403,4 @@ void main() { gl_FragColor = texture2D(uMainSampler, outTexCoord); } } -`;var Pt;class Yt extends Phaser.Renderer.WebGL.Pipelines.PostFXPipeline{constructor(ut){super({game:ut,fragShader:qt});It(this,Pt,void 0);wt(this,Pt,0)}get progress(){return Dt(this,Pt)}set progress(ut){wt(this,Pt,ut)}onPreRender(){this.set1f("uCutoff",Dt(this,Pt))}}Pt=new WeakMap;const Wt="BG";class Lt extends xt.Scene{constructor(){super({key:Lt.name})}preload(){this.load.image(Wt,"assets/images/bg.png")}create(){var nt;this.add.image(0,0,Wt).setOrigin(0),this.renderer.pipelines.addPostPipeline("WipePostFxPipeline",Yt),this.cameras.main.setPostPipeline(Yt),this.tweens.add({targets:this.cameras.main.getPostPipeline("WipePostFxPipeline"),progress:1,duration:2e3,delay:1e3}),(nt=this.input.keyboard)==null||nt.once("keydown-SPACE",()=>{this.scene.start("BuiltInFxScene")})}}const Ht="BG",bt="CHARACTERS";class Ot extends xt.Scene{constructor(){super({key:Ot.name})}preload(){this.load.image(Ht,"assets/images/bg.png"),this.load.spritesheet(bt,"assets/images/custom.png",{frameWidth:64,frameHeight:88})}create(){var ut,mt;this.add.image(0,0,Ht).setOrigin(0),(ut=this.add.image(487,310,bt,7).preFX)==null||ut.addGradient(255,65280,0),(mt=this.input.keyboard)==null||mt.once("keydown-SPACE",()=>{this.scene.start("NothingPostFxScene")})}}const _t={type:xt.WEBGL,pixelArt:!0,scale:{parent:"game-container",width:1024,height:576,mode:xt.Scale.FIT,autoCenter:xt.Scale.CENTER_BOTH},backgroundColor:"#5c5b5b"},At=new xt.Game(_t);At.scene.add(Mt.name,Mt);At.scene.add(Rt.name,Rt);At.scene.add(Ft.name,Ft);At.scene.add(Lt.name,Lt);At.scene.add(Ot.name,Ot);At.scene.start(Mt.name); +`;var Pt;class Nt extends Phaser.Renderer.WebGL.Pipelines.PostFXPipeline{constructor(ut){super({game:ut,fragShader:jt});Lt(this,Pt,void 0);Rt(this,Pt,0)}get progress(){return Mt(this,Pt)}set progress(ut){Rt(this,Pt,ut)}onPreRender(){this.set1f("uCutoff",Mt(this,Pt))}}Pt=new WeakMap;const Ut="BG";class kt extends xt.Scene{constructor(){super({key:"WipePostFxScene"})}preload(){this.load.image(Ut,"assets/images/bg.png")}create(){var nt;this.add.image(0,0,Ut).setOrigin(0),this.renderer.pipelines.addPostPipeline("WipePostFxPipeline",Nt),this.cameras.main.setPostPipeline(Nt),this.tweens.add({targets:this.cameras.main.getPostPipeline("WipePostFxPipeline"),progress:1,duration:2e3,delay:1e3}),(nt=this.input.keyboard)==null||nt.once("keydown-SPACE",()=>{this.scene.start("BuiltInFxScene")})}}const Xt="BG",zt="CHARACTERS";class qt extends xt.Scene{constructor(){super({key:"BuiltInFxScene"})}preload(){this.load.image(Xt,"assets/images/bg.png"),this.load.spritesheet(zt,"assets/images/custom.png",{frameWidth:64,frameHeight:88})}create(){var ut,mt;this.add.image(0,0,Xt).setOrigin(0),(ut=this.add.image(487,310,zt,7).preFX)==null||ut.addGradient(255,65280,0),(mt=this.input.keyboard)==null||mt.once("keydown-SPACE",()=>{this.scene.start("NothingPostFxScene")})}}const _t={type:xt.WEBGL,pixelArt:!0,scale:{parent:"game-container",width:1024,height:576,mode:xt.Scale.FIT,autoCenter:xt.Scale.CENTER_BOTH},backgroundColor:"#5c5b5b"},At=new xt.Game(_t);At.scene.add("NothingPostFxScene",Kt);At.scene.add("ColorPostFxScene",Jt);At.scene.add("GreyScalePostFxScene",$t);At.scene.add("WipePostFxScene",kt);At.scene.add("BuiltInFxScene",qt);At.scene.start("NothingPostFxScene"); diff --git a/examples/shader-examples/index.html b/examples/shader-examples/index.html index fe8f2cd..e74b258 100644 --- a/examples/shader-examples/index.html +++ b/examples/shader-examples/index.html @@ -14,7 +14,7 @@ background: #d7d7d7; } - +