mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
Merge branch '4.1' into 4.2-beta
This commit is contained in:
commit
5103a3da38
@ -18,7 +18,20 @@
|
||||
</ul>
|
||||
<li>Phaser</li>
|
||||
<ul>
|
||||
<li><a href="/spine-phaser/example/index.html">Examples</a></li>
|
||||
<li><a href="/spine-phaser/example/basic-example.html">Basic example</a></li>
|
||||
<li><a href="/spine-phaser/example/batching-test.html">Batching test</a></li>
|
||||
<li><a href="/spine-phaser/example/multi-scene-test.html">Multi-scene test</a></li>
|
||||
<li><a href="/spine-phaser/example/bounds-test.html">Bounds test</a></li>
|
||||
<li><a href="/spine-phaser/example/visibility-test.html">Visibility test</a></li>
|
||||
<li><a href="/spine-phaser/example/arcade-physics-test.html">Arcade physics example</a></li>
|
||||
<li><a href="/spine-phaser/example/blend-test.html">Blend test</a></li>
|
||||
<li><a href="/spine-phaser/example/camera-pipeline-test.html">Camera pipeline test</a></li>
|
||||
<li><a href="/spine-phaser/example/control-bones-test.html">Control bones</a></li>
|
||||
<li><a href="/spine-phaser/example/extended-class-test.html">Extended class</a></li>
|
||||
<li><a href="/spine-phaser/example/canvas-test.html">Canvas test</a></li>
|
||||
<li><a href="/spine-phaser/example/depth-test.html">Depth test</a></li>
|
||||
<li><a href="/spine-phaser/example/render-to-texture-test.html">Render to texture test</a></li>
|
||||
<li><a href="/spine-phaser/example/mix-and-match.html">Mix and match</a></li>
|
||||
</ul>
|
||||
<li>Player</li>
|
||||
<ul>
|
||||
|
||||
@ -124,12 +124,12 @@ export class SkeletonRenderer {
|
||||
if (attachment instanceof RegionAttachment) {
|
||||
let regionAttachment = <RegionAttachment>attachment;
|
||||
vertices = this.computeRegionVertices(slot, regionAttachment, false);
|
||||
triangles = SkeletonRenderer.QUAD_TRIANGLES;
|
||||
triangles = SkeletonRenderer.QUAD_TRIANGLES;
|
||||
texture = (<CanvasTexture>regionAttachment.region!.texture).getImage() as HTMLImageElement;
|
||||
} else if (attachment instanceof MeshAttachment) {
|
||||
let mesh = <MeshAttachment>attachment;
|
||||
vertices = this.computeMeshVertices(slot, mesh, false);
|
||||
triangles = mesh.triangles;
|
||||
triangles = mesh.triangles;
|
||||
texture = (<CanvasTexture>mesh.region!.texture).getImage() as HTMLImageElement;
|
||||
} else
|
||||
continue;
|
||||
|
||||
@ -55,7 +55,7 @@ export class AtlasAttachmentLoader implements AttachmentLoader {
|
||||
let path = sequence.getPath(basePath, i);
|
||||
let region = this.atlas.findRegion(path);
|
||||
if (region == null) throw new Error("Region not found in atlas: " + path + " (sequence: " + name + ")");
|
||||
regions[i] = region;
|
||||
regions[i] = region;
|
||||
}
|
||||
}
|
||||
|
||||
@ -65,7 +65,7 @@ export class AtlasAttachmentLoader implements AttachmentLoader {
|
||||
this.loadSequence(name, path, sequence);
|
||||
} else {
|
||||
let region = this.atlas.findRegion(path);
|
||||
if (!region) throw new Error("Region not found in atlas: " + path + " (region attachment: " + name + ")");
|
||||
if (!region) throw new Error("Region not found in atlas: " + path + " (region attachment: " + name + ")");
|
||||
attachment.region = region;
|
||||
}
|
||||
return attachment;
|
||||
@ -77,7 +77,7 @@ export class AtlasAttachmentLoader implements AttachmentLoader {
|
||||
this.loadSequence(name, path, sequence);
|
||||
} else {
|
||||
let region = this.atlas.findRegion(path);
|
||||
if (!region) throw new Error("Region not found in atlas: " + path + " (mesh attachment: " + name + ")");
|
||||
if (!region) throw new Error("Region not found in atlas: " + path + " (mesh attachment: " + name + ")");
|
||||
attachment.region = region;
|
||||
}
|
||||
return attachment;
|
||||
|
||||
@ -1,31 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<script src="//cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script>
|
||||
<title>Spine Phaser Example</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Spine Phaser</h1>
|
||||
<ul>
|
||||
<li><a href="./basic-example.html">Basic example</a></li>
|
||||
<li><a href="./batching-test.html">Batching test</a></li>
|
||||
<li><a href="./multi-scene-test.html">Multi-scene test</a></li>
|
||||
<li><a href="./bounds-test.html">Bounds test</a></li>
|
||||
<li><a href="./visibility-test.html">Visibility test</a></li>
|
||||
<li><a href="./arcade-physics-test.html">Arcade physics example</a></li>
|
||||
<li><a href="./blend-test.html">Blend test</a></li>
|
||||
<li><a href="./camera-pipeline-test.html">Camera pipeline test</a></li>
|
||||
<li><a href="./control-bones-test.html">Control bones</a></li>
|
||||
<li><a href="./extended-class-test.html">Extended class</a></li>
|
||||
<li><a href="./canvas-test.html">Canvas test</a></li>
|
||||
<li><a href="./depth-test.html">Depth test</a></li>
|
||||
<li><a href="./render-to-texture-test.html">Render to texture test</a></li>
|
||||
</ul>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
60
spine-ts/spine-phaser/example/mix-and-match.html
Normal file
60
spine-ts/spine-phaser/example/mix-and-match.html
Normal file
@ -0,0 +1,60 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<script src="//cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js"></script>
|
||||
<title>Spine Phaser Example</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Mix and match</h1>
|
||||
</body>
|
||||
<script>
|
||||
var config = {
|
||||
type: Phaser.AUTO,
|
||||
width: 800,
|
||||
height: 600,
|
||||
type: Phaser.WEBGL,
|
||||
scene: {
|
||||
preload: preload,
|
||||
create: create,
|
||||
pack: {
|
||||
files: [
|
||||
{ type: "scenePlugin", key: "spine.SpinePlugin", url: "../dist/iife/spine-phaser.js", sceneKey: "spine" }
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let game = new Phaser.Game(config);
|
||||
|
||||
function preload() {
|
||||
this.load.spineBinary("mix-and-match-data", "assets/mix-and-match-pro.skel");
|
||||
this.load.spineAtlas("mix-and-match-atlas", "assets/mix-and-match-pma.atlas");
|
||||
}
|
||||
|
||||
function create() {
|
||||
let mixAndMatch = this.add.spine(400, 500, 'mix-and-match-data', "mix-and-match-atlas");
|
||||
mixAndMatch.scale = 0.5;
|
||||
mixAndMatch.animationState.setAnimation(0, "walk", true);
|
||||
|
||||
let skeletonData = mixAndMatch.skeleton.data;
|
||||
let skin = new spine.Skin("custom");
|
||||
skin.addSkin(skeletonData.findSkin("skin-base"));
|
||||
skin.addSkin(skeletonData.findSkin("nose/short"));
|
||||
skin.addSkin(skeletonData.findSkin("eyelids/girly"));
|
||||
skin.addSkin(skeletonData.findSkin("eyes/violet"));
|
||||
skin.addSkin(skeletonData.findSkin("hair/brown"));
|
||||
skin.addSkin(skeletonData.findSkin("clothes/hoodie-orange"));
|
||||
skin.addSkin(skeletonData.findSkin("legs/pants-jeans"));
|
||||
skin.addSkin(skeletonData.findSkin("accessories/bag"));
|
||||
skin.addSkin(skeletonData.findSkin("accessories/hat-red-yellow"));
|
||||
mixAndMatch.skeleton.setSkin(skin);
|
||||
mixAndMatch.skeleton.setToSetupPose();
|
||||
}
|
||||
</script>
|
||||
|
||||
</html>
|
||||
@ -180,7 +180,7 @@ half4 frag(VertexOutput i
|
||||
i.color.rgb = lerp(i.shadowedColor, i.color.rgb, shadowAttenuation);
|
||||
#endif
|
||||
|
||||
#ifdef _WRITE_RENDERING_LAYERS
|
||||
#ifdef USE_WRITE_RENDERING_LAYERS
|
||||
uint renderingLayers = GetMeshRenderingLayerBackwardsCompatible();
|
||||
outRenderingLayers = float4(EncodeMeshRenderingLayer(renderingLayers), 0, 0, 0);
|
||||
#endif
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user