diff --git a/.gitignore b/.gitignore index 5323ba7d2..961e93f6b 100644 --- a/.gitignore +++ b/.gitignore @@ -185,3 +185,4 @@ spine-flutter/src/spine-cpp spine-godot/.clang-format +spine-ts/spine-phaser/dist diff --git a/examples/export/runtimes.sh b/examples/export/runtimes.sh index 71294a77d..68e4c49cd 100755 --- a/examples/export/runtimes.sh +++ b/examples/export/runtimes.sh @@ -357,6 +357,29 @@ cp -f ../spineboy/export/spineboy-pro.skel "$ROOT/spine-ts/spine-player/example/ cp -f ../spineboy/export/spineboy-pma.atlas "$ROOT/spine-ts/spine-player/example/assets/" cp -f ../spineboy/export/spineboy-pma.png "$ROOT/spine-ts/spine-player/example/assets/" +rm "$ROOT/spine-ts/spine-phaser/example/assets/"* +cp -f ../raptor/export/raptor-pro.json "$ROOT/spine-ts/spine-phaser/example/assets/" +cp -f ../raptor/export/raptor-pma.atlas "$ROOT/spine-ts/spine-phaser/example/assets/" +cp -f ../raptor/export/raptor-pma.png "$ROOT/spine-ts/spine-phaser/example/assets/" + +cp -f ../spineboy/export/spineboy-pro.skel "$ROOT/spine-ts/spine-phaser/example/assets/" +cp -f ../spineboy/export/spineboy-pma.atlas "$ROOT/spine-ts/spine-phaser/example/assets/" +cp -f ../spineboy/export/spineboy-pma.png "$ROOT/spine-ts/spine-phaser/example/assets/" + +cp -f ../coin/export/coin-pro.skel "$ROOT/spine-ts/spine-phaser/example/assets/" +cp -f ../coin/export/coin-pma.atlas "$ROOT/spine-ts/spine-phaser/example/assets/" +cp -f ../coin/export/coin-pma.png "$ROOT/spine-ts/spine-phaser/example/assets/" + +cp -f ../stretchyman/export/stretchyman-pro.json "$ROOT/spine-ts/spine-phaser/example/assets/" +cp -f ../stretchyman/export/stretchyman-pro.skel "$ROOT/spine-ts/spine-phaser/example/assets/" +cp -f ../stretchyman/export/stretchyman-pma.atlas "$ROOT/spine-ts/spine-phaser/example/assets/" +cp -f ../stretchyman/export/stretchyman-pma.png "$ROOT/spine-ts/spine-phaser/example/assets/" + +cp -f ../mix-and-match/export/mix-and-match-pro.json "$ROOT/spine-ts/spine-phaser/example/assets/" +cp -f ../mix-and-match/export/mix-and-match-pro.skel "$ROOT/spine-ts/spine-phaser/example/assets/" +cp -f ../mix-and-match/export/mix-and-match-pma.atlas "$ROOT/spine-ts/spine-phaser/example/assets/" +cp -f ../mix-and-match/export/mix-and-match-pma.png "$ROOT/spine-ts/spine-phaser/example/assets/" + echo "spine-monogame" rm "$ROOT/spine-monogame/spine-monogame-example/data/"* cp -f ../coin/export/coin-pro.json "$ROOT/spine-monogame/spine-monogame-example/data/" diff --git a/spine-sfml/cpp/example/testbed.cpp b/spine-sfml/cpp/example/testbed.cpp index e3faf832a..3bf47baaf 100644 --- a/spine-sfml/cpp/example/testbed.cpp +++ b/spine-sfml/cpp/example/testbed.cpp @@ -34,42 +34,42 @@ using namespace spine; int main(void) { - String atlasFile("data/spineboy-pma.atlas"); - String skeletonFile("data/spineboy-pro.skel"); - float scale = 0.6f; - SFMLTextureLoader textureLoader; - Atlas *atlas = new Atlas(atlasFile, &textureLoader); - SkeletonData *skeletonData = nullptr; - if (strncmp(skeletonFile.buffer(), ".skel", skeletonFile.length()) > 0) { - SkeletonBinary binary(atlas); - binary.setScale(scale); - skeletonData = binary.readSkeletonDataFile(skeletonFile); - } else { - SkeletonJson json(atlas); - json.setScale(scale); - skeletonData = json.readSkeletonDataFile(skeletonFile); - } + String atlasFile("data/spineboy-pma.atlas"); + String skeletonFile("data/spineboy-pro.skel"); + float scale = 0.6f; + SFMLTextureLoader textureLoader; + Atlas *atlas = new Atlas(atlasFile, &textureLoader); + SkeletonData *skeletonData = nullptr; + if (strncmp(skeletonFile.buffer(), ".skel", skeletonFile.length()) > 0) { + SkeletonBinary binary(atlas); + binary.setScale(scale); + skeletonData = binary.readSkeletonDataFile(skeletonFile); + } else { + SkeletonJson json(atlas); + json.setScale(scale); + skeletonData = json.readSkeletonDataFile(skeletonFile); + } - AnimationStateData stateData(skeletonData); - SkeletonDrawable drawable(skeletonData, &stateData); - drawable.skeleton->setPosition(320, 590); - drawable.state->setAnimation(0, "walk", true); + AnimationStateData stateData(skeletonData); + SkeletonDrawable drawable(skeletonData, &stateData); + drawable.skeleton->setPosition(320, 590); + drawable.state->setAnimation(0, "walk", true); - sf::RenderWindow window(sf::VideoMode(640, 640), "Spine SFML - testbed"); - window.setFramerateLimit(60); - sf::Event event; - sf::Clock deltaClock; - while (window.isOpen()) { - while (window.pollEvent(event)) - if (event.type == sf::Event::Closed) window.close(); + sf::RenderWindow window(sf::VideoMode(640, 640), "Spine SFML - testbed"); + window.setFramerateLimit(60); + sf::Event event; + sf::Clock deltaClock; + while (window.isOpen()) { + while (window.pollEvent(event)) + if (event.type == sf::Event::Closed) window.close(); - float delta = deltaClock.getElapsedTime().asSeconds(); - deltaClock.restart(); - drawable.update(delta); - window.clear(); - window.draw(drawable); - window.display(); - } + float delta = deltaClock.getElapsedTime().asSeconds(); + deltaClock.restart(); + drawable.update(delta); + window.clear(); + window.draw(drawable); + window.display(); + } - return 0; + return 0; } \ No newline at end of file diff --git a/spine-ts/.vscode/launch.json b/spine-ts/.vscode/launch.json index 08d870cc9..7b7e86a6b 100644 --- a/spine-ts/.vscode/launch.json +++ b/spine-ts/.vscode/launch.json @@ -31,6 +31,14 @@ "name": "threejs-example", "url": "http://localhost:8080/spine-threejs/example/index.html", "webRoot": "${workspaceFolder}" + }, + { + "type": "pwa-chrome", + "request": "launch", + "name": "phaser-example", + "url": "http://localhost:8080/spine-phaser/example/index.html", + "webRoot": "${workspaceFolder}" } + ] } 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