mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-07 11:16:53 +08:00
Moved Turbulenz to spine-turbulenz to match other runtimes. Fixed example to not use root bone for positioning.
This commit is contained in:
parent
2758eb3ac0
commit
95e27c5a24
|
Before Width: | Height: | Size: 145 KiB After Width: | Height: | Size: 145 KiB |
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 65 KiB |
@ -2,11 +2,11 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>spine-js</title>
|
<title>spine-js</title>
|
||||||
<script src="../spine.js"></script>
|
<script src="../spine-js/spine.js"></script>
|
||||||
<script src="turbulenzengine.js"></script>
|
<script src="../turbulenz/turbulenzengine.js"></script>
|
||||||
<script src="graphicsdevice.js"></script>
|
<script src="../turbulenz/graphicsdevice.js"></script>
|
||||||
<script src="draw2d.js"></script>
|
<script src="../turbulenz/draw2d.js"></script>
|
||||||
<script src="SpriteBatch.js"></script>
|
<script src="../SpriteBatch.js"></script>
|
||||||
<style>body, input { font-family: tahoma; font-size: 11pt }</style>
|
<style>body, input { font-family: tahoma; font-size: 11pt }</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@ -30,7 +30,7 @@ load("spineboy");
|
|||||||
var skeletonName;
|
var skeletonName;
|
||||||
function load (name) {
|
function load (name) {
|
||||||
skeletonName = name;
|
skeletonName = name;
|
||||||
TurbulenzEngine.request("../data/" + skeletonName + ".atlas", loadAtlas);
|
TurbulenzEngine.request("data/" + skeletonName + ".atlas", loadAtlas);
|
||||||
}
|
}
|
||||||
|
|
||||||
var atlas;
|
var atlas;
|
||||||
@ -40,7 +40,7 @@ function loadAtlas (atlasText) {
|
|||||||
load: function (page, path, atlas) {
|
load: function (page, path, atlas) {
|
||||||
textureCount++;
|
textureCount++;
|
||||||
graphicsDevice.createTexture({
|
graphicsDevice.createTexture({
|
||||||
src: "../data/" + path,
|
src: "data/" + path,
|
||||||
mipmaps: true,
|
mipmaps: true,
|
||||||
onload: function (texture) {
|
onload: function (texture) {
|
||||||
page.rendererObject = texture;
|
page.rendererObject = texture;
|
||||||
@ -57,7 +57,7 @@ function loadAtlas (atlasText) {
|
|||||||
});
|
});
|
||||||
function waitForTextures () {
|
function waitForTextures () {
|
||||||
if (!textureCount)
|
if (!textureCount)
|
||||||
TurbulenzEngine.request("../data/" + skeletonName + ".json", loadSkeletonData);
|
TurbulenzEngine.request("data/" + skeletonName + ".json", loadSkeletonData);
|
||||||
else
|
else
|
||||||
setTimeout(waitForTextures, 100);
|
setTimeout(waitForTextures, 100);
|
||||||
}
|
}
|
||||||
@ -75,8 +75,8 @@ function start () {
|
|||||||
spine.Bone.yDown = true;
|
spine.Bone.yDown = true;
|
||||||
|
|
||||||
var skeleton = new spine.Skeleton(skeletonData);
|
var skeleton = new spine.Skeleton(skeletonData);
|
||||||
skeleton.getRootBone().x = 320;
|
skeleton.x = 320;
|
||||||
skeleton.getRootBone().y = 440;
|
skeleton.y = 440;
|
||||||
skeleton.updateWorldTransform();
|
skeleton.updateWorldTransform();
|
||||||
|
|
||||||
var stateData = new spine.AnimationStateData(skeletonData);
|
var stateData = new spine.AnimationStateData(skeletonData);
|
||||||
0
spine-turbulenz/spine-js/Place spine-js here.txt
Normal file
0
spine-turbulenz/spine-js/Place spine-js here.txt
Normal file
Loading…
x
Reference in New Issue
Block a user