diff --git a/.gitignore b/.gitignore
index 57335b326..8bc5fe74a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -179,3 +179,5 @@ spine-godot/logs
spine-ts/spine-ts.zip
*.d
spine-godot/.clang-format
+
+spine-ts/spine-phaser/dist
diff --git a/spine-ts/index.html b/spine-ts/index.html
index 94fe9779c..02607684a 100644
--- a/spine-ts/index.html
+++ b/spine-ts/index.html
@@ -16,6 +16,10 @@
Example
Mouse click
+ Phaser
+
Player
- Example
diff --git a/spine-ts/package-lock.json b/spine-ts/package-lock.json
index c41f92063..4b5bf2617 100644
--- a/spine-ts/package-lock.json
+++ b/spine-ts/package-lock.json
@@ -11,6 +11,7 @@
"workspaces": [
"spine-core",
"spine-canvas",
+ "spine-phaser",
"spine-player",
"spine-threejs",
"spine-webgl"
@@ -19,13 +20,365 @@
"@types/offscreencanvas": "^2019.6.4",
"concurrently": "^6.2.1",
"copyfiles": "^2.4.1",
- "esbuild": "^0.12.22",
+ "esbuild": "^0.16.3",
"live-server": "^1.2.1",
"npx": "^10.2.2",
"rimraf": "^3.0.2",
"typescript": "^4.3.5"
}
},
+ "node_modules/@esbuild/android-arm": {
+ "version": "0.16.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.16.3.tgz",
+ "integrity": "sha512-mueuEoh+s1eRbSJqq9KNBQwI4QhQV6sRXIfTyLXSHGMpyew61rOK4qY21uKbXl1iBoMb0AdL1deWFCQVlN2qHA==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/android-arm64": {
+ "version": "0.16.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.16.3.tgz",
+ "integrity": "sha512-RolFVeinkeraDvN/OoRf1F/lP0KUfGNb5jxy/vkIMeRRChkrX/HTYN6TYZosRJs3a1+8wqpxAo5PI5hFmxyPRg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/android-x64": {
+ "version": "0.16.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.3.tgz",
+ "integrity": "sha512-SFpTUcIT1bIJuCCBMCQWq1bL2gPTjWoLZdjmIhjdcQHaUfV41OQfho6Ici5uvvkMmZRXIUGpM3GxysP/EU7ifQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/darwin-arm64": {
+ "version": "0.16.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.16.3.tgz",
+ "integrity": "sha512-DO8WykMyB+N9mIDfI/Hug70Dk1KipavlGAecxS3jDUwAbTpDXj0Lcwzw9svkhxfpCagDmpaTMgxWK8/C/XcXvw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/darwin-x64": {
+ "version": "0.16.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.16.3.tgz",
+ "integrity": "sha512-uEqZQ2omc6BvWqdCiyZ5+XmxuHEi1SPzpVxXCSSV2+Sh7sbXbpeNhHIeFrIpRjAs0lI1FmA1iIOxFozKBhKgRQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.16.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.16.3.tgz",
+ "integrity": "sha512-nJansp3sSXakNkOD5i5mIz2Is/HjzIhFs49b1tjrPrpCmwgBmH9SSzhC/Z1UqlkivqMYkhfPwMw1dGFUuwmXhw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/freebsd-x64": {
+ "version": "0.16.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.16.3.tgz",
+ "integrity": "sha512-TfoDzLw+QHfc4a8aKtGSQ96Wa+6eimljjkq9HKR0rHlU83vw8aldMOUSJTUDxbcUdcgnJzPaX8/vGWm7vyV7ug==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-arm": {
+ "version": "0.16.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.16.3.tgz",
+ "integrity": "sha512-VwswmSYwVAAq6LysV59Fyqk3UIjbhuc6wb3vEcJ7HEJUtFuLK9uXWuFoH1lulEbE4+5GjtHi3MHX+w1gNHdOWQ==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-arm64": {
+ "version": "0.16.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.16.3.tgz",
+ "integrity": "sha512-7I3RlsnxEFCHVZNBLb2w7unamgZ5sVwO0/ikE2GaYvYuUQs9Qte/w7TqWcXHtCwxvZx/2+F97ndiUQAWs47ZfQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-ia32": {
+ "version": "0.16.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.16.3.tgz",
+ "integrity": "sha512-X8FDDxM9cqda2rJE+iblQhIMYY49LfvW4kaEjoFbTTQ4Go8G96Smj2w3BRTwA8IHGoi9dPOPGAX63dhuv19UqA==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-loong64": {
+ "version": "0.16.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.16.3.tgz",
+ "integrity": "sha512-hIbeejCOyO0X9ujfIIOKjBjNAs9XD/YdJ9JXAy1lHA+8UXuOqbFe4ErMCqMr8dhlMGBuvcQYGF7+kO7waj2KHw==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-mips64el": {
+ "version": "0.16.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.16.3.tgz",
+ "integrity": "sha512-znFRzICT/V8VZQMt6rjb21MtAVJv/3dmKRMlohlShrbVXdBuOdDrGb+C2cZGQAR8RFyRe7HS6klmHq103WpmVw==",
+ "cpu": [
+ "mips64el"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-ppc64": {
+ "version": "0.16.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.16.3.tgz",
+ "integrity": "sha512-EV7LuEybxhXrVTDpbqWF2yehYRNz5e5p+u3oQUS2+ZFpknyi1NXxr8URk4ykR8Efm7iu04//4sBg249yNOwy5Q==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-riscv64": {
+ "version": "0.16.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.16.3.tgz",
+ "integrity": "sha512-uDxqFOcLzFIJ+r/pkTTSE9lsCEaV/Y6rMlQjUI9BkzASEChYL/aSQjZjchtEmdnVxDKETnUAmsaZ4pqK1eE5BQ==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-s390x": {
+ "version": "0.16.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.16.3.tgz",
+ "integrity": "sha512-NbeREhzSxYwFhnCAQOQZmajsPYtX71Ufej3IQ8W2Gxskfz9DK58ENEju4SbpIj48VenktRASC52N5Fhyf/aliQ==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-x64": {
+ "version": "0.16.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.16.3.tgz",
+ "integrity": "sha512-SDiG0nCixYO9JgpehoKgScwic7vXXndfasjnD5DLbp1xltANzqZ425l7LSdHynt19UWOcDjG9wJJzSElsPvk0w==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/netbsd-x64": {
+ "version": "0.16.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.16.3.tgz",
+ "integrity": "sha512-AzbsJqiHEq1I/tUvOfAzCY15h4/7Ivp3ff/o1GpP16n48JMNAtbW0qui2WCgoIZArEHD0SUQ95gvR0oSO7ZbdA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/openbsd-x64": {
+ "version": "0.16.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.16.3.tgz",
+ "integrity": "sha512-gSABi8qHl8k3Cbi/4toAzHiykuBuWLZs43JomTcXkjMZVkp0gj3gg9mO+9HJW/8GB5H89RX/V0QP4JGL7YEEVg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/sunos-x64": {
+ "version": "0.16.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.16.3.tgz",
+ "integrity": "sha512-SF9Kch5Ete4reovvRO6yNjMxrvlfT0F0Flm+NPoUw5Z4Q3r1d23LFTgaLwm3Cp0iGbrU/MoUI+ZqwCv5XJijCw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/win32-arm64": {
+ "version": "0.16.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.16.3.tgz",
+ "integrity": "sha512-u5aBonZIyGopAZyOnoPAA6fGsDeHByZ9CnEzyML9NqntK6D/xl5jteZUKm/p6nD09+v3pTM6TuUIqSPcChk5gg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/win32-ia32": {
+ "version": "0.16.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.16.3.tgz",
+ "integrity": "sha512-GlgVq1WpvOEhNioh74TKelwla9KDuAaLZrdxuuUgsP2vayxeLgVc+rbpIv0IYF4+tlIzq2vRhofV+KGLD+37EQ==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/win32-x64": {
+ "version": "0.16.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.16.3.tgz",
+ "integrity": "sha512-5/JuTd8OWW8UzEtyf19fbrtMJENza+C9JoPIkvItgTBQ1FO2ZLvjbPO6Xs54vk0s5JB5QsfieUEshRQfu7ZHow==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
"node_modules/@esotericsoftware/spine-canvas": {
"resolved": "spine-canvas",
"link": true
@@ -34,6 +387,10 @@
"resolved": "spine-core",
"link": true
},
+ "node_modules/@esotericsoftware/spine-phaser": {
+ "resolved": "spine-phaser",
+ "link": true
+ },
"node_modules/@esotericsoftware/spine-player": {
"resolved": "spine-player",
"link": true
@@ -701,13 +1058,40 @@
}
},
"node_modules/esbuild": {
- "version": "0.12.29",
- "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.12.29.tgz",
- "integrity": "sha512-w/XuoBCSwepyiZtIRsKsetiLDUVGPVw1E/R3VTFSecIy8UR7Cq3SOtwKHJMFoVqqVG36aGkzh4e8BvpO1Fdc7g==",
+ "version": "0.16.3",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.16.3.tgz",
+ "integrity": "sha512-71f7EjPWTiSguen8X/kxEpkAS7BFHwtQKisCDDV3Y4GLGWBaoSCyD5uXkaUew6JDzA9FEN1W23mdnSwW9kqCeg==",
"dev": true,
"hasInstallScript": true,
"bin": {
"esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "optionalDependencies": {
+ "@esbuild/android-arm": "0.16.3",
+ "@esbuild/android-arm64": "0.16.3",
+ "@esbuild/android-x64": "0.16.3",
+ "@esbuild/darwin-arm64": "0.16.3",
+ "@esbuild/darwin-x64": "0.16.3",
+ "@esbuild/freebsd-arm64": "0.16.3",
+ "@esbuild/freebsd-x64": "0.16.3",
+ "@esbuild/linux-arm": "0.16.3",
+ "@esbuild/linux-arm64": "0.16.3",
+ "@esbuild/linux-ia32": "0.16.3",
+ "@esbuild/linux-loong64": "0.16.3",
+ "@esbuild/linux-mips64el": "0.16.3",
+ "@esbuild/linux-ppc64": "0.16.3",
+ "@esbuild/linux-riscv64": "0.16.3",
+ "@esbuild/linux-s390x": "0.16.3",
+ "@esbuild/linux-x64": "0.16.3",
+ "@esbuild/netbsd-x64": "0.16.3",
+ "@esbuild/openbsd-x64": "0.16.3",
+ "@esbuild/sunos-x64": "0.16.3",
+ "@esbuild/win32-arm64": "0.16.3",
+ "@esbuild/win32-ia32": "0.16.3",
+ "@esbuild/win32-x64": "0.16.3"
}
},
"node_modules/escalade": {
@@ -749,6 +1133,11 @@
"through": "~2.3.1"
}
},
+ "node_modules/eventemitter3": {
+ "version": "4.0.7",
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
+ "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="
+ },
"node_modules/expand-brackets": {
"version": "2.1.4",
"resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz",
@@ -6870,6 +7259,15 @@
"node": ">=0.10.0"
}
},
+ "node_modules/path": {
+ "version": "0.12.7",
+ "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz",
+ "integrity": "sha512-aXXC6s+1w7otVF9UletFkFcDsJeO7lSZBPUQhtb5O0xJe8LtYhj/GxldoL09bBj9+ZmE2hNoHqQSFMN5fikh4Q==",
+ "dependencies": {
+ "process": "^0.11.1",
+ "util": "^0.10.3"
+ }
+ },
"node_modules/path-dirname": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz",
@@ -6894,6 +7292,23 @@
"through": "~2.3"
}
},
+ "node_modules/phaser": {
+ "version": "3.55.2",
+ "resolved": "https://registry.npmjs.org/phaser/-/phaser-3.55.2.tgz",
+ "integrity": "sha512-amKXsbb2Ht29dGPKvt1edq3yGGYKtq8373GpJYGKPNPnneYY6MtVTOgjHDuZwtmUyK4v86FugkT3hzW/N4tjxQ==",
+ "dependencies": {
+ "eventemitter3": "^4.0.7",
+ "path": "^0.12.7"
+ }
+ },
+ "node_modules/phaser3-project-template": {
+ "version": "1.0.9",
+ "resolved": "https://registry.npmjs.org/phaser3-project-template/-/phaser3-project-template-1.0.9.tgz",
+ "integrity": "sha512-HUfQHE7Eg2kymO58ojGyIZGWlL7FY145Hdp1j0NAVkYrMJhZ2A3Ha40oe74OIwXx09pLYMRZJA/AepgmlPJcdA==",
+ "dependencies": {
+ "phaser": "^3.3.0"
+ }
+ },
"node_modules/posix-character-classes": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz",
@@ -6903,6 +7318,14 @@
"node": ">=0.10.0"
}
},
+ "node_modules/process": {
+ "version": "0.11.10",
+ "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
+ "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==",
+ "engines": {
+ "node": ">= 0.6.0"
+ }
+ },
"node_modules/process-nextick-args": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
@@ -7848,12 +8271,25 @@
"node": ">=0.10.0"
}
},
+ "node_modules/util": {
+ "version": "0.10.4",
+ "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz",
+ "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==",
+ "dependencies": {
+ "inherits": "2.0.3"
+ }
+ },
"node_modules/util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
"dev": true
},
+ "node_modules/util/node_modules/inherits": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
+ "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw=="
+ },
"node_modules/utils-merge": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
@@ -7986,6 +8422,16 @@
"version": "4.1.24",
"license": "LicenseRef-LICENSE"
},
+ "spine-phaser": {
+ "name": "@esotericsoftware/spine-phaser",
+ "version": "4.2.10",
+ "license": "LicenseRef-LICENSE",
+ "dependencies": {
+ "@esotericsoftware/spine-core": "^4.2.10",
+ "phaser": "^3.55.2",
+ "phaser3-project-template": "^1.0.9"
+ }
+ },
"spine-player": {
"name": "@esotericsoftware/spine-player",
"version": "4.1.24",
diff --git a/spine-ts/package.json b/spine-ts/package.json
index bf0d47a80..92a10b9a8 100644
--- a/spine-ts/package.json
+++ b/spine-ts/package.json
@@ -7,20 +7,22 @@
],
"scripts": {
"prepublish": "npm run clean && npm run build",
- "clean": "npx rimraf spine-core/dist spine-canvas/dist spine-webgl/dist spine-player/dist spine-threejs/dist",
- "build": "npm run clean && npm run build:modules && concurrently \"npm run build:core\" \"npm run build:canvas\" \"npm run build:webgl\" \"npm run build:player\" \"npm run build:threejs\"",
+ "clean": "npx rimraf spine-core/dist spine-canvas/dist spine-webgl/dist spine-phaser/dist spine-player/dist spine-threejs/dist",
+ "build": "npm run clean && npm run build:modules && concurrently \"npm run build:core\" \"npm run build:canvas\" \"npm run build:webgl\" \"npm run build:phaser\" \"npm run build:player\" \"npm run build:threejs\"",
"postbuild": "npm run minify",
"build:modules": "npx tsc -b -clean && npx tsc -b",
"build:core": "npx esbuild --bundle spine-core/src/index.ts --tsconfig=spine-core/tsconfig.json --sourcemap --outfile=spine-core/dist/iife/spine-core.js --format=iife --global-name=spine",
"build:canvas": "npx esbuild --bundle spine-canvas/src/index.ts --tsconfig=spine-canvas/tsconfig.json --sourcemap --outfile=spine-canvas/dist/iife/spine-canvas.js --format=iife --global-name=spine",
"build:webgl": "npx esbuild --bundle spine-webgl/src/index.ts --tsconfig=spine-webgl/tsconfig.json --sourcemap --outfile=spine-webgl/dist/iife/spine-webgl.js --format=iife --global-name=spine",
"build:player": "npx copyfiles -f spine-player/css/spine-player.css spine-player/dist/ && npx npx esbuild --bundle spine-player/src/index.ts --tsconfig=spine-player/tsconfig.json --sourcemap --outfile=spine-player/dist/iife/spine-player.js --format=iife --global-name=spine",
+ "build:phaser": "npx esbuild --bundle spine-phaser/src/index.ts --tsconfig=spine-phaser/tsconfig.json --sourcemap --outfile=spine-phaser/dist/iife/spine-phaser.js --external:Phaser --alias:phaser=Phaser --format=iife --global-name=spine",
"build:threejs": "npx esbuild --bundle spine-threejs/src/index.ts --tsconfig=spine-threejs/tsconfig.json --sourcemap --outfile=spine-threejs/dist/iife/spine-threejs.js --external:three --format=iife --global-name=spine",
"minify": "npx esbuild --minify spine-core/dist/iife/spine-core.js --outfile=spine-core/dist/iife/spine-core.min.js && npx esbuild --minify spine-canvas/dist/iife/spine-canvas.js --outfile=spine-canvas/dist/iife/spine-canvas.min.js && npx esbuild --minify spine-player/dist/iife/spine-player.js --outfile=spine-player/dist/iife/spine-player.min.js && npx esbuild --minify spine-webgl/dist/iife/spine-webgl.js --outfile=spine-webgl/dist/iife/spine-webgl.min.js && npx esbuild --minify spine-threejs/dist/iife/spine-threejs.js --outfile=spine-threejs/dist/iife/spine-threejs.min.js",
- "dev": "concurrently \"npx live-server --no-browser\" \"npm run dev:modules\" \"npm run dev:canvas\" \"npm run dev:webgl\" \"npm run dev:player\" \"npm run dev:threejs\"",
+ "dev": "concurrently \"npx live-server --no-browser\" \"npm run dev:canvas\" \"npm run dev:webgl\" \"npm run dev:phaser\" \"npm run dev:player\" \"npm run dev:threejs\"",
"dev:modules": "npm run build:modules -- --watch",
"dev:canvas": "npm run build:canvas -- --watch",
"dev:webgl": "npm run build:webgl -- --watch",
+ "dev:phaser": "npm run build:phaser -- --watch",
"dev:player": "npm run build:player -- --watch",
"dev:threejs": "npm run build:threejs -- --watch"
},
@@ -46,6 +48,7 @@
"workspaces": [
"spine-core",
"spine-canvas",
+ "spine-phaser",
"spine-player",
"spine-threejs",
"spine-webgl"
@@ -53,7 +56,7 @@
"devDependencies": {
"concurrently": "^6.2.1",
"copyfiles": "^2.4.1",
- "esbuild": "^0.12.22",
+ "esbuild": "^0.16.3",
"live-server": "^1.2.1",
"npx": "^10.2.2",
"rimraf": "^3.0.2",
diff --git a/spine-ts/publish.sh b/spine-ts/publish.sh
index 57b1fcc8d..ccca585eb 100755
--- a/spine-ts/publish.sh
+++ b/spine-ts/publish.sh
@@ -3,7 +3,7 @@ set -e
if [ ! "$#" -eq 2 ]; then
echo "Usage: ./publish.sh "
- exit
+ exit
else
lastVersion=${1%/}
newVersion=${2%/}
@@ -14,6 +14,7 @@ fi
sed -i '' "s/$lastVersion/$newVersion/" package.json
sed -i '' "s/$lastVersion/$newVersion/" spine-canvas/package.json
sed -i '' "s/$lastVersion/$newVersion/" spine-core/package.json
+sed -i '' "s/$lastVersion/$newVersion/" spine-phaser/package.json
sed -i '' "s/$lastVersion/$newVersion/" spine-player/package.json
sed -i '' "s/$lastVersion/$newVersion/" spine-threejs/package.json
sed -i '' "s/$lastVersion/$newVersion/" spine-webgl/package.json
diff --git a/spine-ts/spine-phaser/LICENSE b/spine-ts/spine-phaser/LICENSE
new file mode 100644
index 000000000..4501a611f
--- /dev/null
+++ b/spine-ts/spine-phaser/LICENSE
@@ -0,0 +1,26 @@
+Spine Runtimes License Agreement
+Last updated May 1, 2019. Replaces all prior versions.
+
+Copyright (c) 2013-2019, Esoteric Software LLC
+
+Integration of the Spine Runtimes into software or otherwise creating
+derivative works of the Spine Runtimes is permitted under the terms and
+conditions of Section 2 of the Spine Editor License Agreement:
+http://esotericsoftware.com/spine-editor-license
+
+Otherwise, it is permitted to integrate the Spine Runtimes into software
+or otherwise create derivative works of the Spine Runtimes (collectively,
+"Products"), provided that each user of the Products must obtain their own
+Spine Editor license and redistribution of the Products in any form must
+include this license and copyright notice.
+
+THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS
+OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS
+INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/spine-ts/spine-phaser/README.md b/spine-ts/spine-phaser/README.md
new file mode 100644
index 000000000..93e8aca37
--- /dev/null
+++ b/spine-ts/spine-phaser/README.md
@@ -0,0 +1,3 @@
+# spine-ts Phaser
+
+Please see https://github.com/EsotericSoftware/spine-runtimes/blob/4.0/spine-ts/README.md for more information.
\ No newline at end of file
diff --git a/spine-ts/spine-phaser/example/index.html b/spine-ts/spine-phaser/example/index.html
new file mode 100644
index 000000000..ef3e1dfcf
--- /dev/null
+++ b/spine-ts/spine-phaser/example/index.html
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+ Spine Phaser Example
+
+
+ Spine Phaser
+
+
+
\ No newline at end of file
diff --git a/spine-ts/spine-phaser/example/index.js b/spine-ts/spine-phaser/example/index.js
new file mode 100644
index 000000000..823227c06
--- /dev/null
+++ b/spine-ts/spine-phaser/example/index.js
@@ -0,0 +1,27 @@
+
+///
+///
+///
+///
+
+var config = {
+ type: Phaser.AUTO,
+ width: 800,
+ height: 600,
+ scene: {
+ preload: preload,
+ create: create
+ }
+};
+
+var game = new Phaser.Game(config);
+
+function preload () {
+ this.load.scenePlugin("spine.SpinePlugin", "../dist/iife/spine-phaser.js", "spinePlugin", "spinePlugin");
+}
+
+function create () {
+ let plugin = this.spinePlugin;
+ let numbers = plugin.getNumbers(10);
+ this.add.text(10, 10, numbers, { font: '16px Courier', fill: '#00ff00' });
+}
\ No newline at end of file
diff --git a/spine-ts/spine-phaser/package.json b/spine-ts/spine-phaser/package.json
new file mode 100644
index 000000000..16ac17992
--- /dev/null
+++ b/spine-ts/spine-phaser/package.json
@@ -0,0 +1,37 @@
+{
+ "name": "@esotericsoftware/spine-phaser",
+ "version": "4.2.10",
+ "description": "The official Spine Runtimes for the Phaser.",
+ "main": "dist/index.js",
+ "types": "dist/index.d.ts",
+ "files": [
+ "dist/**/*",
+ "README.md",
+ "LICENSE"
+ ],
+ "scripts": {},
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/esotericsoftware/spine-runtimes.git"
+ },
+ "keywords": [
+ "gamedev",
+ "animations",
+ "2d",
+ "spine",
+ "game-dev",
+ "runtimes",
+ "skeletal"
+ ],
+ "author": "Esoteric Software LLC",
+ "license": "LicenseRef-LICENSE",
+ "bugs": {
+ "url": "https://github.com/esotericsoftware/spine-runtimes/issues"
+ },
+ "homepage": "https://github.com/esotericsoftware/spine-runtimes#readme",
+ "dependencies": {
+ "@esotericsoftware/spine-core": "^4.2.10",
+ "phaser": "^3.55.2",
+ "phaser3-project-template": "^1.0.9"
+ }
+}
diff --git a/spine-ts/spine-phaser/src/SpinePlugin.ts b/spine-ts/spine-phaser/src/SpinePlugin.ts
new file mode 100644
index 000000000..6412917cf
--- /dev/null
+++ b/spine-ts/spine-phaser/src/SpinePlugin.ts
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * Spine Runtimes License Agreement
+ * Last updated September 24, 2021. Replaces all prior versions.
+ *
+ * Copyright (c) 2013-2021, Esoteric Software LLC
+ *
+ * Integration of the Spine Runtimes into software or otherwise creating
+ * derivative works of the Spine Runtimes is permitted under the terms and
+ * conditions of Section 2 of the Spine Editor License Agreement:
+ * http://esotericsoftware.com/spine-editor-license
+ *
+ * Otherwise, it is permitted to integrate the Spine Runtimes into software
+ * or otherwise create derivative works of the Spine Runtimes (collectively,
+ * "Products"), provided that each user of the Products must obtain their own
+ * Spine Editor license and redistribution of the Products in any form must
+ * include this license and copyright notice.
+ *
+ * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
+ * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *****************************************************************************/
+
+import Phaser from "phaser";
+
+export class SpinePlugin extends Phaser.Plugins.ScenePlugin {
+ SpinePlugin() {
+ }
+
+ getNumbers(count: number) {
+ let numbers = [];
+ for (let i = 0; i < count; i++)
+ numbers.push(i);
+ return numbers;
+ }
+}
\ No newline at end of file
diff --git a/spine-ts/spine-phaser/src/index.ts b/spine-ts/spine-phaser/src/index.ts
new file mode 100644
index 000000000..33252c056
--- /dev/null
+++ b/spine-ts/spine-phaser/src/index.ts
@@ -0,0 +1,9 @@
+export * from "./require-shim"
+import { SpinePlugin } from "./SpinePlugin";
+{
+ let w = window as any;
+ w["spine.SpinePlugin"] = SpinePlugin;
+}
+export * from "./SpinePlugin"
+export * from "@esotericsoftware/spine-core";
+export * from "@esotericsoftware/spine-canvas";
diff --git a/spine-ts/spine-phaser/src/require-shim.ts b/spine-ts/spine-phaser/src/require-shim.ts
new file mode 100644
index 000000000..3b812412a
--- /dev/null
+++ b/spine-ts/spine-phaser/src/require-shim.ts
@@ -0,0 +1,11 @@
+declare global {
+ var require: any;
+}
+if (window.Phaser) {
+ let prevRequire = window.require;
+ window.require = (x: string) => {
+ if (prevRequire) return prevRequire(x);
+ else if (x === "Phaser") return window.Phaser;
+ }
+}
+export {}
\ No newline at end of file
diff --git a/spine-ts/spine-phaser/tsconfig.json b/spine-ts/spine-phaser/tsconfig.json
new file mode 100644
index 000000000..389c26f51
--- /dev/null
+++ b/spine-ts/spine-phaser/tsconfig.json
@@ -0,0 +1,36 @@
+{
+ "extends": "../tsconfig.base.json",
+ "compilerOptions": {
+ "baseUrl": ".",
+ "rootDir": "./src",
+ "outDir": "./dist",
+ "paths": {
+ "@esotericsoftware/spine-core": [
+ "../spine-core/src"
+ ],
+ "@esotericsoftware/spine-canvas": [
+ "../spine-canvas/src"
+ ],
+ "@esotericsoftware/spine-webgl": [
+ "../spine-webgl/src"
+ ]
+ }
+ },
+ "include": [
+ "**/*.ts",
+ ],
+ "exclude": [
+ "dist/**/*.d.ts"
+ ],
+ "references": [
+ {
+ "path": "../spine-core"
+ },
+ {
+ "path": "../spine-canvas"
+ },
+ {
+ "path": "../spine-webgl"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/spine-ts/spine-player/src/index.ts b/spine-ts/spine-player/src/index.ts
index c2014d9ea..e6df25d5e 100644
--- a/spine-ts/spine-player/src/index.ts
+++ b/spine-ts/spine-player/src/index.ts
@@ -1,3 +1,3 @@
export * from './Player';
export * from "@esotericsoftware/spine-core";
-export * from "@esotericsoftware/spine-webgl";
+export * from "@esotericsoftware/spine-webgl";
\ No newline at end of file
diff --git a/spine-ts/tsconfig.json b/spine-ts/tsconfig.json
index 6724f4789..d981bf510 100644
--- a/spine-ts/tsconfig.json
+++ b/spine-ts/tsconfig.json
@@ -10,6 +10,9 @@
{
"path": "./spine-webgl"
},
+ {
+ "path": "./spine-phaser"
+ },
{
"path": "./spine-player"
},