mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[ts][pixi-v8] Upgraded inline-loading example accordingly with Pixi 8.12.
This commit is contained in:
parent
79c09e80f8
commit
1297228f91
@ -2,7 +2,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<title>spine-pixi-v8</title>
|
<title>spine-pixi-v8</title>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/pixi.js@8.4.1/dist/pixi.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/pixi.js@8.12/dist/pixi.js"></script>
|
||||||
<script src="../dist/iife/spine-pixi-v8.js"></script>
|
<script src="../dist/iife/spine-pixi-v8.js"></script>
|
||||||
<link rel="stylesheet" href="../../index.css">
|
<link rel="stylesheet" href="../../index.css">
|
||||||
</head>
|
</head>
|
||||||
@ -32,21 +32,21 @@
|
|||||||
|
|
||||||
const textureBase64 = await PIXI.Assets.load({
|
const textureBase64 = await PIXI.Assets.load({
|
||||||
alias: 'textureBase64',
|
alias: 'textureBase64',
|
||||||
loadParser: 'loadTextures',
|
parser: 'loadTextures',
|
||||||
src: base64Data.png,
|
src: base64Data.png,
|
||||||
})
|
})
|
||||||
|
|
||||||
PIXI.Assets.add({
|
PIXI.Assets.add({
|
||||||
alias: "atlasBase64",
|
alias: "atlasBase64",
|
||||||
loadParser: "spineTextureAtlasLoader",
|
parser: "spineTextureAtlasLoader",
|
||||||
src: base64Data.atlas,
|
src: base64Data.atlas,
|
||||||
data: { images: { "inline.png": textureBase64.source } }
|
data: { images: { "inline.png": textureBase64.source } }
|
||||||
})
|
})
|
||||||
|
|
||||||
PIXI.Assets.add({
|
PIXI.Assets.add({
|
||||||
alias: "skelBase64",
|
alias: "skelBase64",
|
||||||
loadParser: "spineSkeletonLoader",
|
parser: "spineSkeletonLoader",
|
||||||
// loadParser: "loadJson", // use "loadJson", if asset is json
|
// parser: "loadJson", // use "loadJson", if asset is json
|
||||||
src: base64Data.skel,
|
src: base64Data.skel,
|
||||||
})
|
})
|
||||||
await PIXI.Assets.load(["skelBase64", "atlasBase64"]);
|
await PIXI.Assets.load(["skelBase64", "atlasBase64"]);
|
||||||
@ -69,22 +69,22 @@
|
|||||||
|
|
||||||
const textureBlob = await PIXI.Assets.load({
|
const textureBlob = await PIXI.Assets.load({
|
||||||
alias: 'textureBlob',
|
alias: 'textureBlob',
|
||||||
loadParser: 'loadTextures',
|
parser: 'loadTextures',
|
||||||
src: URL.createObjectURL(blobData.png),
|
src: URL.createObjectURL(blobData.png),
|
||||||
// data: { alphaMode: PIXI.ALPHA_MODES.PMA } // if texture is pma uncomment this and set as pixi preference (preferCreateImageBitmap: false)
|
// data: { alphaMode: PIXI.ALPHA_MODES.PMA } // if texture is pma uncomment this and set as pixi preference (preferCreateImageBitmap: false)
|
||||||
})
|
})
|
||||||
|
|
||||||
PIXI.Assets.add({
|
PIXI.Assets.add({
|
||||||
alias: "atlasBlob",
|
alias: "atlasBlob",
|
||||||
loadParser: "spineTextureAtlasLoader",
|
parser: "spineTextureAtlasLoader",
|
||||||
src: URL.createObjectURL(blobData.atlas),
|
src: URL.createObjectURL(blobData.atlas),
|
||||||
data: { images: { "inline.png": textureBlob.source } }
|
data: { images: { "inline.png": textureBlob.source } }
|
||||||
})
|
})
|
||||||
|
|
||||||
PIXI.Assets.add({
|
PIXI.Assets.add({
|
||||||
alias: "skelBlob",
|
alias: "skelBlob",
|
||||||
// loadParser: "spineSkeletonLoader", // use "spineSkeletonLoader", if asset is skel
|
// parser: "spineSkeletonLoader", // use "spineSkeletonLoader", if asset is skel
|
||||||
loadParser: "loadJson",
|
parser: "loadJson",
|
||||||
src: URL.createObjectURL(blobData.json),
|
src: URL.createObjectURL(blobData.json),
|
||||||
})
|
})
|
||||||
await PIXI.Assets.load(["skelBlob", "atlasBlob"]);
|
await PIXI.Assets.load(["skelBlob", "atlasBlob"]);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user