mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[ts] Fixed sack (physics4) examples.
This commit is contained in:
parent
517d9341b6
commit
5cb6577df3
@ -17,7 +17,7 @@
|
|||||||
class BasicExample extends Phaser.Scene {
|
class BasicExample extends Phaser.Scene {
|
||||||
preload() {
|
preload() {
|
||||||
this.load.spineBinary("sack-data", "/assets/sack-pro.skel");
|
this.load.spineBinary("sack-data", "/assets/sack-pro.skel");
|
||||||
this.load.spineAtlas("sack-atlas", "/assets/7-anticipation.atlas");
|
this.load.spineAtlas("sack-atlas", "/assets/sack.atlas");
|
||||||
}
|
}
|
||||||
|
|
||||||
create() {
|
create() {
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
class BasicExample extends Phaser.Scene {
|
class BasicExample extends Phaser.Scene {
|
||||||
preload() {
|
preload() {
|
||||||
this.load.spineBinary("sack-data", "/assets/sack-pro.skel");
|
this.load.spineBinary("sack-data", "/assets/sack-pro.skel");
|
||||||
this.load.spineAtlas("sack-atlas", "/assets/7-anticipation.atlas");
|
this.load.spineAtlas("sack-atlas", "/assets/sack.atlas");
|
||||||
}
|
}
|
||||||
|
|
||||||
create() {
|
create() {
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
// Pre-load the skeleton data and atlas. You can also load .json skeleton data.
|
// Pre-load the skeleton data and atlas. You can also load .json skeleton data.
|
||||||
PIXI.Assets.add("sackData", "/assets/sack-pro.skel");
|
PIXI.Assets.add("sackData", "/assets/sack-pro.skel");
|
||||||
PIXI.Assets.add("sackAtlas", "/assets/7-anticipation-pma.atlas");
|
PIXI.Assets.add("sackAtlas", "/assets/sack-pma.atlas");
|
||||||
await PIXI.Assets.load(["sackData", "sackAtlas"]);
|
await PIXI.Assets.load(["sackData", "sackAtlas"]);
|
||||||
|
|
||||||
// Create the spine display object
|
// Create the spine display object
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
// Pre-load the skeleton data and atlas. You can also load .json skeleton data.
|
// Pre-load the skeleton data and atlas. You can also load .json skeleton data.
|
||||||
PIXI.Assets.add({alias: "sackData", src: "/assets/sack-pro.skel"});
|
PIXI.Assets.add({alias: "sackData", src: "/assets/sack-pro.skel"});
|
||||||
PIXI.Assets.add({alias: "sackAtlas", src: "/assets/7-anticipation-pma.atlas"});
|
PIXI.Assets.add({alias: "sackAtlas", src: "/assets/sack-pma.atlas"});
|
||||||
await PIXI.Assets.load(["sackData", "sackAtlas"]);
|
await PIXI.Assets.load(["sackData", "sackAtlas"]);
|
||||||
|
|
||||||
// Create the spine display object
|
// Create the spine display object
|
||||||
|
|||||||
@ -998,7 +998,7 @@ async function updateCelesteAnimations() {
|
|||||||
<div class="split-right">
|
<div class="split-right">
|
||||||
<spine-skeleton
|
<spine-skeleton
|
||||||
identifier="sack-debug"
|
identifier="sack-debug"
|
||||||
atlas="/assets/7-anticipation-pma.atlas"
|
atlas="/assets/sack-pma.atlas"
|
||||||
skeleton="/assets/sack-pro.skel"
|
skeleton="/assets/sack-pro.skel"
|
||||||
animation="cape-follow-example"
|
animation="cape-follow-example"
|
||||||
debug
|
debug
|
||||||
@ -1018,7 +1018,7 @@ async function updateCelesteAnimations() {
|
|||||||
<script>escapeHTMLandInject(`
|
<script>escapeHTMLandInject(`
|
||||||
<spine-skeleton
|
<spine-skeleton
|
||||||
identifier="sack-debug"
|
identifier="sack-debug"
|
||||||
atlas="/assets/7-anticipation-pma.atlas"
|
atlas="/assets/sack-pma.atlas"
|
||||||
skeleton="/assets/sack-pro.skel"
|
skeleton="/assets/sack-pro.skel"
|
||||||
animation="cape-follow-example"
|
animation="cape-follow-example"
|
||||||
debug
|
debug
|
||||||
|
|||||||
@ -25,14 +25,14 @@
|
|||||||
// Load the skeleton file.
|
// Load the skeleton file.
|
||||||
canvas.assetManager.loadBinary("/assets/sack-pro.skel");
|
canvas.assetManager.loadBinary("/assets/sack-pro.skel");
|
||||||
// Load the atlas and its pages.
|
// Load the atlas and its pages.
|
||||||
canvas.assetManager.loadTextureAtlas("/assets/7-anticipation-pma.atlas");
|
canvas.assetManager.loadTextureAtlas("/assets/sack-pma.atlas");
|
||||||
}
|
}
|
||||||
|
|
||||||
initialize(canvas) {
|
initialize(canvas) {
|
||||||
let assetManager = canvas.assetManager;
|
let assetManager = canvas.assetManager;
|
||||||
|
|
||||||
// Create the texture atlas.
|
// Create the texture atlas.
|
||||||
var atlas = assetManager.require("/assets/7-anticipation-pma.atlas");
|
var atlas = assetManager.require("/assets/sack-pma.atlas");
|
||||||
|
|
||||||
// Create a AtlasAttachmentLoader that resolves region, mesh, boundingbox and path attachments
|
// Create a AtlasAttachmentLoader that resolves region, mesh, boundingbox and path attachments
|
||||||
var atlasLoader = new spine.AtlasAttachmentLoader(atlas);
|
var atlasLoader = new spine.AtlasAttachmentLoader(atlas);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user