From f3179e09dca25afee0b521cd9043e342cf1f6847 Mon Sep 17 00:00:00 2001 From: Rex Date: Sat, 30 Sep 2023 23:51:50 +0800 Subject: [PATCH] Rename --- examples/loader/load-atlas-from-binary.bat | 5 +++++ .../{load-binary-atlas.js => load-atlas-from-binary.js} | 0 examples/loader/load-binary-and-image.bat | 4 ---- examples/loader/load-binary-atlas.bat | 5 ----- examples/loader/load-image-from-binary.bat | 4 ++++ .../{load-binary-and-image.js => load-image-from-binary.js} | 6 +++--- 6 files changed, 12 insertions(+), 12 deletions(-) create mode 100644 examples/loader/load-atlas-from-binary.bat rename examples/loader/{load-binary-atlas.js => load-atlas-from-binary.js} (100%) delete mode 100644 examples/loader/load-binary-and-image.bat delete mode 100644 examples/loader/load-binary-atlas.bat create mode 100644 examples/loader/load-image-from-binary.bat rename examples/loader/{load-binary-and-image.js => load-image-from-binary.js} (81%) diff --git a/examples/loader/load-atlas-from-binary.bat b/examples/loader/load-atlas-from-binary.bat new file mode 100644 index 0000000000..a4edc4dcbf --- /dev/null +++ b/examples/loader/load-atlas-from-binary.bat @@ -0,0 +1,5 @@ +@echo off +set main=./examples/loader/load-atlas-from-binary.js +cd .. +cd .. +npm run watch \ No newline at end of file diff --git a/examples/loader/load-binary-atlas.js b/examples/loader/load-atlas-from-binary.js similarity index 100% rename from examples/loader/load-binary-atlas.js rename to examples/loader/load-atlas-from-binary.js diff --git a/examples/loader/load-binary-and-image.bat b/examples/loader/load-binary-and-image.bat deleted file mode 100644 index a03c9dbf17..0000000000 --- a/examples/loader/load-binary-and-image.bat +++ /dev/null @@ -1,4 +0,0 @@ -set main=./examples/loader/load-binary-and-image.js -cd .. -cd .. -npm run watch \ No newline at end of file diff --git a/examples/loader/load-binary-atlas.bat b/examples/loader/load-binary-atlas.bat deleted file mode 100644 index 5814b4dd1c..0000000000 --- a/examples/loader/load-binary-atlas.bat +++ /dev/null @@ -1,5 +0,0 @@ -@echo off -set main=./examples/loader/load-binary-atlas.js -cd .. -cd .. -npm run watch \ No newline at end of file diff --git a/examples/loader/load-image-from-binary.bat b/examples/loader/load-image-from-binary.bat new file mode 100644 index 0000000000..7f8efdf272 --- /dev/null +++ b/examples/loader/load-image-from-binary.bat @@ -0,0 +1,4 @@ +set main=./examples/loader/load-image-from-binary.js +cd .. +cd .. +npm run watch \ No newline at end of file diff --git a/examples/loader/load-binary-and-image.js b/examples/loader/load-image-from-binary.js similarity index 81% rename from examples/loader/load-binary-and-image.js rename to examples/loader/load-image-from-binary.js index 85073e0b94..6313c460b5 100644 --- a/examples/loader/load-binary-and-image.js +++ b/examples/loader/load-image-from-binary.js @@ -9,13 +9,13 @@ class Demo extends Phaser.Scene { preload() { var key = 'card'; - this.load.binary('card', 'assets/images/card2.png', Uint8Array); + this.load.binary(key, 'assets/images/card2.png', Uint8Array); this.load.once(`filecomplete-binary-${key}`, function () { var buffer = this.cache.binary.get(key); var blob = new Blob([buffer], { type: 'image/png' }); - var url = window.URL.createObjectURL(blob); - this.load.image(key, url); + var blobURL = window.URL.createObjectURL(blob); + this.load.image(key, blobURL); }, this); }