mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-28 04:31:27 +08:00
[ts][player] Added iframe tests.
This commit is contained in:
parent
05d5f6d6e0
commit
b8a8df486d
29
spine-ts/widget/example/iframe-local.html
Normal file
29
spine-ts/widget/example/iframe-local.html
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<script src="../../build/spine-widget.js"></script>
|
||||||
|
<link rel="stylesheet" href="../css/spine-player.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
html, body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
* {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="player"></div>
|
||||||
|
</body>
|
||||||
|
<script>
|
||||||
|
window.addEventListener("message", function (event) {
|
||||||
|
new spine.SpinePlayer(document.getElementById("player"), event.data);
|
||||||
|
}, false);
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
29
spine-ts/widget/example/iframe-test.html
Normal file
29
spine-ts/widget/example/iframe-test.html
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
iframe {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<!--<iframe id="player" src="http://esotericsoftware.com/spine-player/3.7/iframe.html" width="600" height="480"></iframe>-->
|
||||||
|
<iframe id="player" src="http://localhost:8000/widget/example/iframe-local.html" width="600" height="480"></iframe>
|
||||||
|
</body>
|
||||||
|
<script>
|
||||||
|
var player = document.getElementById("player");
|
||||||
|
var playerConfig = {
|
||||||
|
atlasUrl: "http://esotericsoftware.com/files/examples/spineboy/export/spineboy-pma.atlas",
|
||||||
|
jsonUrl: "http://esotericsoftware.com/files/examples/spineboy/export/spineboy-pro.json",
|
||||||
|
premultipliedAlpha: true
|
||||||
|
};
|
||||||
|
player.addEventListener("load", function () {
|
||||||
|
player.contentWindow.postMessage(playerConfig, "*");
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</html>
|
||||||
29
spine-ts/widget/example/iframe.html
Normal file
29
spine-ts/widget/example/iframe.html
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<script src="./spine-widget.js"></script>
|
||||||
|
<link rel="stylesheet" href="./spine-player.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
html, body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
* {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="player"></div>
|
||||||
|
</body>
|
||||||
|
<script>
|
||||||
|
window.addEventListener("message", function (event) {
|
||||||
|
new spine.SpinePlayer(document.getElementById("player"), event.data);
|
||||||
|
}, false);
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
x
Reference in New Issue
Block a user