editor.html 1.2 KB

123456789101112131415161718192021222324252627
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <script src="../dist/iife/spine-player.js"></script>
  7. <link rel="stylesheet" href="../../index.css" />
  8. <title>Spine Player Editor</title>
  9. </head>
  10. <body class="flex flex-col w-full h-screen items-center">
  11. <div id="editor" class="w-full h-full flex-grow"></div>
  12. <script>
  13. var code =
  14. '<script src="https://unpkg.com/@esotericsoftware/[email protected].*/dist/iife/spine-player.js"></' +
  15. 'script>\n<link rel="stylesheet" href="https://unpkg.com/@esotericsoftware/[email protected].*/dist/spine-player.css">\n\n<div id="player-container" style="width: 100%; height: 100vh;"></div>\n\n<script>\nnew spine.SpinePlayer("player-container", {\n skeleton: "http://esotericsoftware.com/files/examples/4.3/spineboy/export/spineboy-pro.json",\n atlas: "http://esotericsoftware.com/files/examples/4.3/spineboy/export/spineboy.atlas",\n premultipliedAlpha: false\n});\n</' +
  16. "script>".trim();
  17. spine.SpinePlayerEditor.DEFAULT_CODE = code;
  18. var player = new spine.SpinePlayerEditor(
  19. document.getElementById("editor")
  20. );
  21. </script>
  22. </body>
  23. </html>