From be39aebfb7b07a49e723230ed77065c593f2f7c3 Mon Sep 17 00:00:00 2001 From: Scott Westover Date: Fri, 3 May 2024 11:59:08 -0400 Subject: [PATCH] updated examples Signed-off-by: Scott Westover --- .../assets/js/{index-i7aewE3B.js => index-BIaGW3cl.js} | 2 +- examples/scene-transition-bitmap-mask/index.html | 2 +- .../assets/js/{index-BUIz7ZLw.js => index-DKDmIUGq.js} | 2 +- examples/scene-transition-geometry-mask/index.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename examples/scene-transition-bitmap-mask/assets/js/{index-i7aewE3B.js => index-BIaGW3cl.js} (99%) rename examples/scene-transition-geometry-mask/assets/js/{index-BUIz7ZLw.js => index-DKDmIUGq.js} (99%) diff --git a/examples/scene-transition-bitmap-mask/assets/js/index-i7aewE3B.js b/examples/scene-transition-bitmap-mask/assets/js/index-BIaGW3cl.js similarity index 99% rename from examples/scene-transition-bitmap-mask/assets/js/index-i7aewE3B.js rename to examples/scene-transition-bitmap-mask/assets/js/index-BIaGW3cl.js index 1d607ab..137949d 100644 --- a/examples/scene-transition-bitmap-mask/assets/js/index-i7aewE3B.js +++ b/examples/scene-transition-bitmap-mask/assets/js/index-BIaGW3cl.js @@ -6342,4 +6342,4 @@ 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)}}},vt={};function at(p){var S=vt[p];if(S!==void 0)return S.exports;var t=vt[p]={exports:{}};return ut[p](t,t.exports,at),t.exports}at.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}();var gt=at(85454);return gt})())})(Ft);var It=Ft.exports;const xt=Bt(It);function Gt(ht,dt){return new Promise(ut=>{ht.events.on(xt.Scenes.Events.CREATE,()=>{const vt={ease:xt.Math.Easing.Expo.InOut,from:.5,start:.5,to:3};ht.tweens.add({duration:3500,scaleX:vt,scaleY:vt,targets:dt,onComplete:()=>{ut()}})})})}function Nt(ht,dt){return new Promise(ut=>{ht.events.on(xt.Scenes.Events.CREATE,()=>{const vt={ease:xt.Math.Easing.Expo.InOut,from:1,start:1,to:0};ht.tweens.add({duration:3400,alpha:vt,targets:dt,onComplete:()=>{ut()}})})})}var Pt,Lt,At,Ot;class Ut extends xt.Scene{constructor(){super({key:"MainScene"});Mt(this,Pt);Mt(this,At)}preload(){this.load.image("BACKGROUND","assets/images/ansimuz/starfighter/background.png"),this.load.spritesheet("SHIP","assets/images/ansimuz/warped-vehicle/ship.png",{frameWidth:176,frameHeight:96})}create(){this.add.image(0,0,"BACKGROUND",0).setOrigin(0);const ut=Rt(this,Pt,Lt).call(this),vt=Rt(this,At,Ot).call(this);ut.setMask(vt),Promise.all([Gt(this,vt.bitmapMask),Nt(this,ut)]).then(()=>{console.log("scene transition done")}).catch(()=>{})}}Pt=new WeakSet,Lt=function(){const{height:ut,width:vt}=this.scale,at=this.add.graphics();return at.fillStyle(0,1).fillRect(0,0,vt,ut),at},At=new WeakSet,Ot=function(){this.anims.create({key:"SHIP_IDLE",frames:this.anims.generateFrameNumbers("SHIP"),frameRate:6,repeat:-1});const{height:ut,width:vt}=this.scale,at=this.add.sprite(vt/2,ut/2,"SHIP",0).setScale(2).setVisible(!1);at.play("SHIP_IDLE");const gt=new xt.Display.Masks.BitmapMask(this,at);return gt.invertAlpha=!0,gt};window.onload=()=>{const ht={type:xt.WEBGL,pixelArt:!0,scale:{zoom:3,parent:"game-container",width:420,height:240},backgroundColor:"#5c5b5b",scene:Ut};new xt.Game(ht)}; + */p.exports={Format:t(27902),Pad:t(41836),RemoveAt:t(33628),Reverse:t(27671),UppercaseFirst:t(35355),UUID:t(45650)}}},vt={};function at(p){var S=vt[p];if(S!==void 0)return S.exports;var t=vt[p]={exports:{}};return ut[p](t,t.exports,at),t.exports}at.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}();var gt=at(85454);return gt})())})(Ft);var It=Ft.exports;const xt=Bt(It);function Gt(ht,dt){return new Promise(ut=>{ht.events.on(xt.Scenes.Events.CREATE,()=>{const vt={ease:xt.Math.Easing.Expo.InOut,from:.5,start:.5,to:3};ht.tweens.add({duration:3500,scaleX:vt,scaleY:vt,targets:dt,onComplete:()=>{ut()}})})})}function Nt(ht,dt){return new Promise(ut=>{ht.events.on(xt.Scenes.Events.CREATE,()=>{const vt={ease:xt.Math.Easing.Expo.InOut,from:1,start:1,to:0};ht.tweens.add({duration:3400,alpha:vt,targets:dt,onComplete:()=>{ut()}})})})}var Pt,Lt,At,Ot;class Ut extends xt.Scene{constructor(){super({key:"MainScene"});Mt(this,Pt);Mt(this,At)}preload(){this.load.image("BACKGROUND","assets/images/ansimuz/starfighter/background.png"),this.load.spritesheet("SHIP","assets/images/ansimuz/warped-vehicle/ship.png",{frameWidth:176,frameHeight:96})}create(){this.add.image(0,0,"BACKGROUND",0).setOrigin(0);const ut=Rt(this,Pt,Lt).call(this),vt=Rt(this,At,Ot).call(this);ut.setMask(vt),Promise.all([Gt(this,vt.bitmapMask),Nt(this,ut)]).then(()=>{console.log("scene transition done"),this.time.delayedCall(500,()=>this.scene.restart())}).catch(()=>{})}}Pt=new WeakSet,Lt=function(){const{height:ut,width:vt}=this.scale,at=this.add.graphics();return at.fillStyle(0,1).fillRect(0,0,vt,ut),at},At=new WeakSet,Ot=function(){this.anims.create({key:"SHIP_IDLE",frames:this.anims.generateFrameNumbers("SHIP"),frameRate:6,repeat:-1});const{height:ut,width:vt}=this.scale,at=this.add.sprite(vt/2,ut/2,"SHIP",0).setScale(2).setVisible(!1);at.play("SHIP_IDLE");const gt=new xt.Display.Masks.BitmapMask(this,at);return gt.invertAlpha=!0,gt};window.onload=()=>{const ht={type:xt.WEBGL,pixelArt:!0,scale:{zoom:3,parent:"game-container",width:420,height:240},backgroundColor:"#5c5b5b",scene:Ut};new xt.Game(ht)}; diff --git a/examples/scene-transition-bitmap-mask/index.html b/examples/scene-transition-bitmap-mask/index.html index fb32880..0c8097d 100644 --- a/examples/scene-transition-bitmap-mask/index.html +++ b/examples/scene-transition-bitmap-mask/index.html @@ -17,7 +17,7 @@ align-items: center; } - +
diff --git a/examples/scene-transition-geometry-mask/assets/js/index-BUIz7ZLw.js b/examples/scene-transition-geometry-mask/assets/js/index-DKDmIUGq.js similarity index 99% rename from examples/scene-transition-geometry-mask/assets/js/index-BUIz7ZLw.js rename to examples/scene-transition-geometry-mask/assets/js/index-DKDmIUGq.js index 3672bfe..55d849a 100644 --- a/examples/scene-transition-geometry-mask/assets/js/index-BUIz7ZLw.js +++ b/examples/scene-transition-geometry-mask/assets/js/index-DKDmIUGq.js @@ -6342,4 +6342,4 @@ 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)}}},gt={};function at(p){var S=gt[p];if(S!==void 0)return S.exports;var t=gt[p]={exports:{}};return dt[p](t,t.exports,at),t.exports}at.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}();var pt=at(85454);return pt})())})(Rt);var wt=Rt.exports;const Ct=Dt(wt);function Bt(lt,ct){return new Promise(dt=>{lt.events.on(Ct.Scenes.Events.CREATE,()=>{const gt={ease:Ct.Math.Easing.Expo.InOut,from:0,start:0,to:2.5};lt.tweens.add({duration:3500,scaleX:gt,scaleY:gt,targets:ct,onComplete:()=>{dt()}})})})}var Pt,Ft;class It extends Ct.Scene{constructor(){super({key:"MainScene"});At(this,Pt)}preload(){this.load.image("BACKGROUND","assets/images/ansimuz/starfighter/background.png"),this.load.spritesheet("SHIP","assets/images/ansimuz/warped-vehicle/ship.png",{frameWidth:176,frameHeight:96})}create(){const{height:dt,width:gt}=this.scale;this.add.image(0,0,"BACKGROUND",0).setOrigin(0),Mt(this,Pt,Ft).call(this);const at=this.add.circle(gt/2,dt/2,dt/2).setVisible(!1),pt=at.createGeometryMask();this.cameras.main.setMask(pt),Bt(this,at).then(()=>{console.log("scene transition done")}).catch(()=>{})}}Pt=new WeakSet,Ft=function(){this.anims.create({key:"SHIP_IDLE",frames:this.anims.generateFrameNumbers("SHIP"),frameRate:6,repeat:-1});const{height:dt,width:gt}=this.scale,at=this.add.sprite(0,dt/2,"SHIP",0);at.play("SHIP_IDLE"),this.tweens.add({targets:at,x:gt,duration:6e3})};window.onload=()=>{const lt={type:Ct.CANVAS,pixelArt:!0,scale:{zoom:3,parent:"game-container",width:420,height:240},backgroundColor:"#000000",scene:It};new Ct.Game(lt)}; + */p.exports={Format:t(27902),Pad:t(41836),RemoveAt:t(33628),Reverse:t(27671),UppercaseFirst:t(35355),UUID:t(45650)}}},gt={};function at(p){var S=gt[p];if(S!==void 0)return S.exports;var t=gt[p]={exports:{}};return dt[p](t,t.exports,at),t.exports}at.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}();var pt=at(85454);return pt})())})(Rt);var wt=Rt.exports;const Ct=Dt(wt);function Bt(lt,ct){return new Promise(dt=>{lt.events.on(Ct.Scenes.Events.CREATE,()=>{const gt={ease:Ct.Math.Easing.Expo.InOut,from:0,start:0,to:2.5};lt.tweens.add({duration:3500,scaleX:gt,scaleY:gt,targets:ct,onComplete:()=>{dt()}})})})}var Pt,Ft;class It extends Ct.Scene{constructor(){super({key:"MainScene"});At(this,Pt)}preload(){this.load.image("BACKGROUND","assets/images/ansimuz/starfighter/background.png"),this.load.spritesheet("SHIP","assets/images/ansimuz/warped-vehicle/ship.png",{frameWidth:176,frameHeight:96})}create(){const{height:dt,width:gt}=this.scale;this.add.image(0,0,"BACKGROUND",0).setOrigin(0),Mt(this,Pt,Ft).call(this);const at=this.add.circle(gt/2,dt/2,dt/2).setVisible(!1),pt=at.createGeometryMask();this.cameras.main.setMask(pt),Bt(this,at).then(()=>{console.log("scene transition done")}).catch(()=>{})}}Pt=new WeakSet,Ft=function(){this.anims.create({key:"SHIP_IDLE",frames:this.anims.generateFrameNumbers("SHIP"),frameRate:6,repeat:-1});const{height:dt,width:gt}=this.scale,at=this.add.sprite(0,dt/2,"SHIP",0);at.play("SHIP_IDLE"),this.tweens.add({targets:at,x:gt+100,duration:6e3,onComplete:()=>{this.scene.restart()}})};window.onload=()=>{const lt={type:Ct.CANVAS,pixelArt:!0,scale:{zoom:3,parent:"game-container",width:420,height:240},backgroundColor:"#000000",scene:It};new Ct.Game(lt)}; diff --git a/examples/scene-transition-geometry-mask/index.html b/examples/scene-transition-geometry-mask/index.html index 0263ca9..c923add 100644 --- a/examples/scene-transition-geometry-mask/index.html +++ b/examples/scene-transition-geometry-mask/index.html @@ -17,7 +17,7 @@ align-items: center; } - +