feat: added added new skin to ptilopsis

well, i have to make changes to spine-ts so it can handle the difference between the size of texture
This commit is contained in:
Haoyu Xu
2025-05-02 21:38:09 +08:00
parent 093f9d7f1a
commit 0af19cf652
385 changed files with 12361 additions and 121068 deletions

1730
apps/module/build/spine-webgl.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,28 +0,0 @@
#!/bin/sh
set -e
if [ -z "$GITHUB_REF" ];
then
BRANCH=$(git symbolic-ref --short -q HEAD)
else
BRANCH=${GITHUB_REF#refs/heads/}
fi
echo "Building spine-ts $BRANCH artifacts"
npm install @types/offscreencanvas
tsc -p tsconfig.json
tsc -p tsconfig.core.json
tsc -p tsconfig.webgl.json
tsc -p tsconfig.canvas.json
tsc -p tsconfig.threejs.json
tsc -p tsconfig.player.json
ls build/*.js build/*.ts | awk '{print "unexpand -t 4 ", $0, " > /tmp/e; mv /tmp/e ", $0}' | sh
if ! [ -z "$TS_UPDATE_URL" ] && ! [ -z "$BRANCH" ];
then
echo "Deploying spine-ts $BRANCH artifacts"
zip -j spine-ts.zip build/* player/css/spine-player.css player/example/external/*
curl -F "file=@spine-ts.zip" "$TS_UPDATE_URL$BRANCH"
else
echo "Not deploying artifacts. TS_UPDATE_URL and/or BRANCH not set."
fi

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -1,286 +0,0 @@
spineboy.png
size: 1024,256
format: RGBA8888
filter: Linear,Linear
repeat: none
crosshair
rotate: false
xy: 813, 160
size: 45, 45
orig: 45, 45
offset: 0, 0
index: -1
eye-indifferent
rotate: false
xy: 569, 2
size: 47, 45
orig: 47, 45
offset: 0, 0
index: -1
eye-surprised
rotate: true
xy: 643, 7
size: 47, 45
orig: 47, 45
offset: 0, 0
index: -1
front-bracer
rotate: false
xy: 811, 51
size: 29, 40
orig: 29, 40
offset: 0, 0
index: -1
front-fist-closed
rotate: false
xy: 807, 93
size: 38, 41
orig: 38, 41
offset: 0, 0
index: -1
front-fist-open
rotate: false
xy: 815, 210
size: 43, 44
orig: 43, 44
offset: 0, 0
index: -1
front-foot
rotate: true
xy: 706, 64
size: 63, 35
orig: 63, 35
offset: 0, 0
index: -1
front-shin
rotate: false
xy: 80, 11
size: 41, 92
orig: 41, 92
offset: 0, 0
index: -1
front-thigh
rotate: false
xy: 754, 12
size: 23, 56
orig: 23, 56
offset: 0, 0
index: -1
front-upper-arm
rotate: false
xy: 618, 5
size: 23, 49
orig: 23, 49
offset: 0, 0
index: -1
goggles
rotate: false
xy: 214, 20
size: 131, 83
orig: 131, 83
offset: 0, 0
index: -1
gun
rotate: true
xy: 347, 14
size: 105, 102
orig: 105, 102
offset: 0, 0
index: -1
head
rotate: false
xy: 80, 105
size: 136, 149
orig: 136, 149
offset: 0, 0
index: -1
hoverboard-board
rotate: true
xy: 2, 8
size: 246, 76
orig: 246, 76
offset: 0, 0
index: -1
hoverboard-thruster
rotate: false
xy: 478, 2
size: 30, 32
orig: 30, 32
offset: 0, 0
index: -1
hoverglow-small
rotate: true
xy: 218, 117
size: 137, 38
orig: 137, 38
offset: 0, 0
index: -1
mouth-grind
rotate: true
xy: 775, 80
size: 47, 30
orig: 47, 30
offset: 0, 0
index: -1
mouth-oooo
rotate: true
xy: 779, 31
size: 47, 30
orig: 47, 30
offset: 0, 0
index: -1
mouth-smile
rotate: true
xy: 783, 207
size: 47, 30
orig: 47, 30
offset: 0, 0
index: -1
muzzle-glow
rotate: false
xy: 779, 4
size: 25, 25
orig: 25, 25
offset: 0, 0
index: -1
muzzle-ring
rotate: false
xy: 451, 14
size: 25, 105
orig: 25, 105
offset: 0, 0
index: -1
muzzle01
rotate: true
xy: 664, 60
size: 67, 40
orig: 67, 40
offset: 0, 0
index: -1
muzzle02
rotate: true
xy: 580, 56
size: 68, 42
orig: 68, 42
offset: 0, 0
index: -1
muzzle03
rotate: true
xy: 478, 36
size: 83, 53
orig: 83, 53
offset: 0, 0
index: -1
muzzle04
rotate: true
xy: 533, 49
size: 75, 45
orig: 75, 45
offset: 0, 0
index: -1
muzzle05
rotate: true
xy: 624, 56
size: 68, 38
orig: 68, 38
offset: 0, 0
index: -1
neck
rotate: false
xy: 806, 8
size: 18, 21
orig: 18, 21
offset: 0, 0
index: -1
portal-bg
rotate: false
xy: 258, 121
size: 133, 133
orig: 133, 133
offset: 0, 0
index: -1
portal-flare1
rotate: true
xy: 690, 2
size: 56, 30
orig: 56, 30
offset: 0, 0
index: -1
portal-flare2
rotate: false
xy: 510, 3
size: 57, 31
orig: 57, 31
offset: 0, 0
index: -1
portal-flare3
rotate: true
xy: 722, 4
size: 58, 30
orig: 58, 30
offset: 0, 0
index: -1
portal-shade
rotate: false
xy: 393, 121
size: 133, 133
orig: 133, 133
offset: 0, 0
index: -1
portal-streaks1
rotate: false
xy: 528, 126
size: 126, 128
orig: 126, 128
offset: 0, 0
index: -1
portal-streaks2
rotate: false
xy: 656, 129
size: 125, 125
orig: 125, 125
offset: 0, 0
index: -1
rear-bracer
rotate: false
xy: 826, 13
size: 28, 36
orig: 28, 36
offset: 0, 0
index: -1
rear-foot
rotate: true
xy: 743, 70
size: 57, 30
orig: 57, 30
offset: 0, 0
index: -1
rear-shin
rotate: false
xy: 174, 14
size: 38, 89
orig: 38, 89
offset: 0, 0
index: -1
rear-thigh
rotate: false
xy: 783, 158
size: 28, 47
orig: 28, 47
offset: 0, 0
index: -1
rear-upper-arm
rotate: true
xy: 783, 136
size: 20, 44
orig: 20, 44
offset: 0, 0
index: -1
torso
rotate: false
xy: 123, 13
size: 49, 90
orig: 49, 90
offset: 0, 0
index: -1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 261 KiB

View File

@@ -1,168 +0,0 @@
<html>
<script src="../../build/spine-canvas.js"></script>
<script src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
<style>
* { margin: 0; padding: 0; }
body, html { height: 100% }
canvas { position: absolute; width: 100% ;height: 100%; }
</style>
<body>
<canvas id="canvas"></canvas>
</body>
<script>
var lastFrameTime = Date.now() / 1000;
var canvas, context;
var assetManager;
var skeleton, state, bounds;
var skeletonRenderer;
var skelName = "spineboy-ess";
var animName = "walk";
function init () {
canvas = document.getElementById("canvas");
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
context = canvas.getContext("2d");
skeletonRenderer = new spine.canvas.SkeletonRenderer(context);
// enable debug rendering
skeletonRenderer.debugRendering = true;
// enable the triangle renderer, supports meshes, but may produce artifacts in some browsers
skeletonRenderer.triangleRendering = false;
assetManager = new spine.canvas.AssetManager();
assetManager.loadText("assets/" + skelName + ".json");
assetManager.loadText("assets/" + skelName.replace("-pro", "").replace("-ess", "") + ".atlas");
assetManager.loadTexture("assets/" + skelName.replace("-pro", "").replace("-ess", "") + ".png");
requestAnimationFrame(load);
}
function load () {
if (assetManager.isLoadingComplete()) {
var data = loadSkeleton(skelName, animName, "default");
skeleton = data.skeleton;
state = data.state;
bounds = data.bounds;
requestAnimationFrame(render);
} else {
requestAnimationFrame(load);
}
}
function loadSkeleton (name, initialAnimation, skin) {
if (skin === undefined) skin = "default";
// Load the texture atlas using name.atlas and name.png from the AssetManager.
// The function passed to TextureAtlas is used to resolve relative paths.
atlas = new spine.TextureAtlas(assetManager.get("assets/" + name.replace("-pro", "").replace("-ess", "") + ".atlas"), function(path) {
return assetManager.get("assets/" + path);
});
// Create a AtlasAttachmentLoader, which is specific to the WebGL backend.
atlasLoader = new spine.AtlasAttachmentLoader(atlas);
// Create a SkeletonJson instance for parsing the .json file.
var skeletonJson = new spine.SkeletonJson(atlasLoader);
// Set the scale to apply during parsing, parse the file, and create a new skeleton.
var skeletonData = skeletonJson.readSkeletonData(assetManager.get("assets/" + name + ".json"));
var skeleton = new spine.Skeleton(skeletonData);
skeleton.scaleY = -1;
var bounds = calculateBounds(skeleton);
skeleton.setSkinByName(skin);
// Create an AnimationState, and set the initial animation in looping mode.
var animationState = new spine.AnimationState(new spine.AnimationStateData(skeleton.data));
animationState.setAnimation(0, initialAnimation, true);
animationState.addListener({
event: function(trackIndex, event) {
// console.log("Event on track " + trackIndex + ": " + JSON.stringify(event));
},
complete: function(trackIndex, loopCount) {
// console.log("Animation on track " + trackIndex + " completed, loop count: " + loopCount);
},
start: function(trackIndex) {
// console.log("Animation on track " + trackIndex + " started");
},
end: function(trackIndex) {
// console.log("Animation on track " + trackIndex + " ended");
}
})
// Pack everything up and return to caller.
return { skeleton: skeleton, state: animationState, bounds: bounds };
}
function calculateBounds(skeleton) {
var data = skeleton.data;
skeleton.setToSetupPose();
skeleton.updateWorldTransform();
var offset = new spine.Vector2();
var size = new spine.Vector2();
skeleton.getBounds(offset, size, []);
return { offset: offset, size: size };
}
function render () {
var now = Date.now() / 1000;
var delta = now - lastFrameTime;
lastFrameTime = now;
resize();
context.save();
context.setTransform(1, 0, 0, 1, 0, 0);
context.fillStyle = "#cccccc";
context.fillRect(0, 0, canvas.width, canvas.height);
context.restore();
state.update(delta);
state.apply(skeleton);
skeleton.updateWorldTransform();
skeletonRenderer.draw(skeleton);
context.strokeStyle = "green";
context.beginPath();
context.moveTo(-1000, 0);
context.lineTo(1000, 0);
context.moveTo(0, -1000);
context.lineTo(0, 1000);
context.stroke();
requestAnimationFrame(render);
}
function resize () {
var w = canvas.clientWidth;
var h = canvas.clientHeight;
if (canvas.width != w || canvas.height != h) {
canvas.width = w;
canvas.height = h;
}
// magic
var centerX = bounds.offset.x + bounds.size.x / 2;
var centerY = bounds.offset.y + bounds.size.y / 2;
var scaleX = bounds.size.x / canvas.width;
var scaleY = bounds.size.y / canvas.height;
var scale = Math.max(scaleX, scaleY) * 1.2;
if (scale < 1) scale = 1;
var width = canvas.width * scale;
var height = canvas.height * scale;
context.setTransform(1, 0, 0, 1, 0, 0);
context.scale(1 / scale, 1 / scale);
context.translate(-centerX, -centerY);
context.translate(width / 2, height / 2);
}
(function() {
init();
}());
</script>
</html>

View File

@@ -1,38 +0,0 @@
/******************************************************************************
* Spine Runtimes License Agreement
* Last updated January 1, 2020. Replaces all prior versions.
*
* Copyright (c) 2013-2020, Esoteric Software LLC
*
* Integration of the Spine Runtimes into software or otherwise creating
* derivative works of the Spine Runtimes is permitted under the terms and
* conditions of Section 2 of the Spine Editor License Agreement:
* http://esotericsoftware.com/spine-editor-license
*
* Otherwise, it is permitted to integrate the Spine Runtimes into software
* or otherwise create derivative works of the Spine Runtimes (collectively,
* "Products"), provided that each user of the Products must obtain their own
* Spine Editor license and redistribution of the Products in any form must
* include this license and copyright notice.
*
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
/// <reference path="../../core/src/AssetManager.ts"/>
module spine.canvas {
export class AssetManager extends spine.AssetManager {
constructor (pathPrefix: string = "") {
super((image: HTMLImageElement) => { return new spine.canvas.CanvasTexture(image); }, pathPrefix);
}
}
}

View File

@@ -1,42 +0,0 @@
/******************************************************************************
* Spine Runtimes License Agreement
* Last updated January 1, 2020. Replaces all prior versions.
*
* Copyright (c) 2013-2020, Esoteric Software LLC
*
* Integration of the Spine Runtimes into software or otherwise creating
* derivative works of the Spine Runtimes is permitted under the terms and
* conditions of Section 2 of the Spine Editor License Agreement:
* http://esotericsoftware.com/spine-editor-license
*
* Otherwise, it is permitted to integrate the Spine Runtimes into software
* or otherwise create derivative works of the Spine Runtimes (collectively,
* "Products"), provided that each user of the Products must obtain their own
* Spine Editor license and redistribution of the Products in any form must
* include this license and copyright notice.
*
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
/// <reference path="../../core/src/Texture.ts"/>
module spine.canvas {
export class CanvasTexture extends Texture {
constructor (image: HTMLImageElement) {
super(image);
}
setFilters (minFilter: TextureFilter, magFilter: TextureFilter) { }
setWraps (uWrap: TextureWrap, vWrap: TextureWrap) { }
dispose () { }
}
}

View File

@@ -1,323 +0,0 @@
/******************************************************************************
* Spine Runtimes License Agreement
* Last updated January 1, 2020. Replaces all prior versions.
*
* Copyright (c) 2013-2020, Esoteric Software LLC
*
* Integration of the Spine Runtimes into software or otherwise creating
* derivative works of the Spine Runtimes is permitted under the terms and
* conditions of Section 2 of the Spine Editor License Agreement:
* http://esotericsoftware.com/spine-editor-license
*
* Otherwise, it is permitted to integrate the Spine Runtimes into software
* or otherwise create derivative works of the Spine Runtimes (collectively,
* "Products"), provided that each user of the Products must obtain their own
* Spine Editor license and redistribution of the Products in any form must
* include this license and copyright notice.
*
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
module spine.canvas {
export class SkeletonRenderer {
static QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0];
static VERTEX_SIZE = 2 + 2 + 4;
private ctx: CanvasRenderingContext2D;
public triangleRendering = false;
public debugRendering = false;
private vertices = Utils.newFloatArray(8 * 1024);
private tempColor = new Color();
constructor (context: CanvasRenderingContext2D) {
this.ctx = context;
}
draw (skeleton: Skeleton) {
if (this.triangleRendering) this.drawTriangles(skeleton);
else this.drawImages(skeleton);
}
private drawImages (skeleton: Skeleton) {
let ctx = this.ctx;
let drawOrder = skeleton.drawOrder;
if (this.debugRendering) ctx.strokeStyle = "green";
ctx.save();
for (let i = 0, n = drawOrder.length; i < n; i++) {
let slot = drawOrder[i];
if (!slot.bone.active) continue;
let attachment = slot.getAttachment();
let regionAttachment: RegionAttachment = null;
let region: TextureAtlasRegion = null;
let image: HTMLImageElement = null;
if (attachment instanceof RegionAttachment) {
regionAttachment = <RegionAttachment>attachment;
region = <TextureAtlasRegion>regionAttachment.region;
image = (<CanvasTexture>region.texture).getImage() as HTMLImageElement;
} else continue;
let skeleton = slot.bone.skeleton;
let skeletonColor = skeleton.color;
let slotColor = slot.color;
let regionColor = regionAttachment.color;
let alpha = skeletonColor.a * slotColor.a * regionColor.a;
let color = this.tempColor;
color.set(skeletonColor.r * slotColor.r * regionColor.r,
skeletonColor.g * slotColor.g * regionColor.g,
skeletonColor.b * slotColor.b * regionColor.b,
alpha);
let att = <RegionAttachment>attachment;
let bone = slot.bone;
let w = region.width;
let h = region.height;
ctx.save();
ctx.transform(bone.a, bone.c, bone.b, bone.d, bone.worldX, bone.worldY);
ctx.translate(attachment.offset[0], attachment.offset[1]);
ctx.rotate(attachment.rotation * Math.PI / 180);
let atlasScale = att.width / w;
ctx.scale(atlasScale * attachment.scaleX, atlasScale * attachment.scaleY);
ctx.translate(w / 2, h / 2);
if (attachment.region.rotate) {
let t = w;
w = h;
h = t;
ctx.rotate(-Math.PI / 2);
}
ctx.scale(1, -1);
ctx.translate(-w / 2, -h / 2);
ctx.globalAlpha = color.a;
// experimental tinting via compositing, doesn't work
// ctx.globalCompositeOperation = "source-atop";
// ctx.fillStyle = "rgba(" + (color.r * 255 | 0) + ", " + (color.g * 255 | 0) + ", " + (color.b * 255 | 0) + ", " + color.a + ")";
// ctx.fillRect(0, 0, w, h);
ctx.drawImage(image, region.x, region.y, w, h, 0, 0, w, h);
if (this.debugRendering) ctx.strokeRect(0, 0, w, h);
ctx.restore();
}
ctx.restore();
}
private drawTriangles (skeleton: Skeleton) {
let blendMode: BlendMode = null;
let vertices: ArrayLike<number> = this.vertices;
let triangles: Array<number> = null;
let drawOrder = skeleton.drawOrder;
for (let i = 0, n = drawOrder.length; i < n; i++) {
let slot = drawOrder[i];
let attachment = slot.getAttachment();
let texture: HTMLImageElement = null;
let region: TextureAtlasRegion = null;
if (attachment instanceof RegionAttachment) {
let regionAttachment = <RegionAttachment>attachment;
vertices = this.computeRegionVertices(slot, regionAttachment, false);
triangles = SkeletonRenderer.QUAD_TRIANGLES;
region = <TextureAtlasRegion>regionAttachment.region;
texture = (<CanvasTexture>region.texture).getImage() as HTMLImageElement;
} else if (attachment instanceof MeshAttachment) {
let mesh = <MeshAttachment>attachment;
vertices = this.computeMeshVertices(slot, mesh, false);
triangles = mesh.triangles;
texture = (<TextureAtlasRegion>mesh.region.renderObject).texture.getImage() as HTMLImageElement;
} else continue;
if (texture != null) {
let slotBlendMode = slot.data.blendMode;
if (slotBlendMode != blendMode) {
blendMode = slotBlendMode;
}
let skeleton = slot.bone.skeleton;
let skeletonColor = skeleton.color;
let slotColor = slot.color;
let attachmentColor = attachment.color;
let alpha = skeletonColor.a * slotColor.a * attachmentColor.a;
let color = this.tempColor;
color.set(skeletonColor.r * slotColor.r * attachmentColor.r,
skeletonColor.g * slotColor.g * attachmentColor.g,
skeletonColor.b * slotColor.b * attachmentColor.b,
alpha);
let ctx = this.ctx;
ctx.globalAlpha = color.a;
// experimental tinting via compositing, doesn't work
// ctx.globalCompositeOperation = "source-atop";
// ctx.fillStyle = "rgba(" + (color.r * 255 | 0) + ", " + (color.g * 255 | 0) + ", " + (color.b * 255 | 0) + ", " + color.a + ")";
// ctx.fillRect(0, 0, w, h);
for (var j = 0; j < triangles.length; j+=3) {
let t1 = triangles[j] * 8, t2 = triangles[j+1] * 8, t3 = triangles[j+2] * 8;
let x0 = vertices[t1], y0 = vertices[t1 + 1], u0 = vertices[t1 + 6], v0 = vertices[t1 + 7];
let x1 = vertices[t2], y1 = vertices[t2 + 1], u1 = vertices[t2 + 6], v1 = vertices[t2 + 7];
let x2 = vertices[t3], y2 = vertices[t3 + 1], u2 = vertices[t3 + 6], v2 = vertices[t3 + 7];
this.drawTriangle(texture, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2);
if (this.debugRendering) {
ctx.strokeStyle = "green";
ctx.beginPath();
ctx.moveTo(x0, y0);
ctx.lineTo(x1, y1);
ctx.lineTo(x2, y2);
ctx.lineTo(x0, y0);
ctx.stroke();
}
}
}
}
this.ctx.globalAlpha = 1;
}
// Adapted from http://extremelysatisfactorytotalitarianism.com/blog/?p=2120
// Apache 2 licensed
private drawTriangle(img: HTMLImageElement, x0: number, y0: number, u0: number, v0: number,
x1: number, y1: number, u1: number, v1: number,
x2: number, y2: number, u2: number, v2: number) {
let ctx = this.ctx;
u0 *= img.width;
v0 *= img.height;
u1 *= img.width;
v1 *= img.height;
u2 *= img.width;
v2 *= img.height;
ctx.beginPath();
ctx.moveTo(x0, y0);
ctx.lineTo(x1, y1);
ctx.lineTo(x2, y2);
ctx.closePath();
x1 -= x0;
y1 -= y0;
x2 -= x0;
y2 -= y0;
u1 -= u0;
v1 -= v0;
u2 -= u0;
v2 -= v0;
var det = 1 / (u1*v2 - u2*v1),
// linear transformation
a = (v2*x1 - v1*x2) * det,
b = (v2*y1 - v1*y2) * det,
c = (u1*x2 - u2*x1) * det,
d = (u1*y2 - u2*y1) * det,
// translation
e = x0 - a*u0 - c*v0,
f = y0 - b*u0 - d*v0;
ctx.save();
ctx.transform(a, b, c, d, e, f);
ctx.clip();
ctx.drawImage(img, 0, 0);
ctx.restore();
}
private computeRegionVertices(slot: Slot, region: RegionAttachment, pma: boolean) {
let skeleton = slot.bone.skeleton;
let skeletonColor = skeleton.color;
let slotColor = slot.color;
let regionColor = region.color;
let alpha = skeletonColor.a * slotColor.a * regionColor.a;
let multiplier = pma ? alpha : 1;
let color = this.tempColor;
color.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier,
skeletonColor.g * slotColor.g * regionColor.g * multiplier,
skeletonColor.b * slotColor.b * regionColor.b * multiplier,
alpha);
region.computeWorldVertices(slot.bone, this.vertices, 0, SkeletonRenderer.VERTEX_SIZE);
let vertices = this.vertices;
let uvs = region.uvs;
vertices[RegionAttachment.C1R] = color.r;
vertices[RegionAttachment.C1G] = color.g;
vertices[RegionAttachment.C1B] = color.b;
vertices[RegionAttachment.C1A] = color.a;
vertices[RegionAttachment.U1] = uvs[0];
vertices[RegionAttachment.V1] = uvs[1];
vertices[RegionAttachment.C2R] = color.r;
vertices[RegionAttachment.C2G] = color.g;
vertices[RegionAttachment.C2B] = color.b;
vertices[RegionAttachment.C2A] = color.a;
vertices[RegionAttachment.U2] = uvs[2];
vertices[RegionAttachment.V2] = uvs[3];
vertices[RegionAttachment.C3R] = color.r;
vertices[RegionAttachment.C3G] = color.g;
vertices[RegionAttachment.C3B] = color.b;
vertices[RegionAttachment.C3A] = color.a;
vertices[RegionAttachment.U3] = uvs[4];
vertices[RegionAttachment.V3] = uvs[5];
vertices[RegionAttachment.C4R] = color.r;
vertices[RegionAttachment.C4G] = color.g;
vertices[RegionAttachment.C4B] = color.b;
vertices[RegionAttachment.C4A] = color.a;
vertices[RegionAttachment.U4] = uvs[6];
vertices[RegionAttachment.V4] = uvs[7];
return vertices;
}
private computeMeshVertices(slot: Slot, mesh: MeshAttachment, pma: boolean) {
let skeleton = slot.bone.skeleton;
let skeletonColor = skeleton.color;
let slotColor = slot.color;
let regionColor = mesh.color;
let alpha = skeletonColor.a * slotColor.a * regionColor.a;
let multiplier = pma ? alpha : 1;
let color = this.tempColor;
color.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier,
skeletonColor.g * slotColor.g * regionColor.g * multiplier,
skeletonColor.b * slotColor.b * regionColor.b * multiplier,
alpha);
let numVertices = mesh.worldVerticesLength / 2;
if (this.vertices.length < mesh.worldVerticesLength) {
this.vertices = Utils.newFloatArray(mesh.worldVerticesLength);
}
let vertices = this.vertices;
mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, SkeletonRenderer.VERTEX_SIZE);
let uvs = mesh.uvs;
for (let i = 0, n = numVertices, u = 0, v = 2; i < n; i++) {
vertices[v++] = color.r;
vertices[v++] = color.g;
vertices[v++] = color.b;
vertices[v++] = color.a;
vertices[v++] = uvs[u++];
vertices[v++] = uvs[u++];
v += 2;
}
return vertices;
}
}
}

View File

@@ -78,8 +78,8 @@ module spine {
page.texture = textureLoader(line);
page.texture.setFilters(page.minFilter, page.magFilter);
page.texture.setWraps(page.uWrap, page.vWrap);
page.width = page.texture.getImage().width;
page.height = page.texture.getImage().height;
// page.width = page.texture.getImage().width;
// page.height = page.texture.getImage().height;
this.pages.push(page);
} else {
let region:TextureAtlasRegion = new TextureAtlasRegion();

View File

@@ -349,29 +349,35 @@ module spine {
}
export class TimeKeeper {
maxDelta = 0.064;
framesPerSecond = 0;
delta = 0;
totalTime = 0;
framesPerSecond = 0
delta = 0
totalTime = 0
private lastTime = Date.now() / 1000;
private frameCount = 0;
private frameTime = 0;
private lastTime = performance.now() / 1000
private frameCount = 0
private frameTime = 0
private fpsInterval = 1 / 60
update () {
let now = Date.now() / 1000;
this.delta = now - this.lastTime;
this.frameTime += this.delta;
this.totalTime += this.delta;
if (this.delta > this.maxDelta) this.delta = this.maxDelta;
this.lastTime = now;
update() {
const now = performance.now() / 1000
this.delta = now - this.lastTime
if (this.delta > this.fpsInterval) {
this.frameTime += this.delta
this.totalTime += this.delta
this.lastTime = now
this.frameCount++;
if (this.frameTime > 1) {
this.framesPerSecond = this.frameCount / this.frameTime;
this.frameTime = 0;
this.frameCount = 0;
}
this.frameCount++
if (this.frameTime > 1) {
this.framesPerSecond = this.frameCount / this.frameTime
this.frameTime = 0
this.frameCount = 0
}
} else {
this.delta = -1
}
}
setFps(v: number) {
this.fpsInterval = 1 / v
}
}

View File

@@ -82,7 +82,10 @@ module spine {
let u = this.region.u, v = this.region.v, width = 0, height = 0;
if (this.region instanceof TextureAtlasRegion) {
let region = this.region;
let textureWidth = region.texture.getImage().width, textureHeight = region.texture.getImage().height;
// let textureWidth = region.texture.getImage().width, textureHeight = region.texture.getImage().height;
let page = this.region.page;
let textureWidth = page.width,
textureHeight = page.height;
switch(region.degrees) {
case 90:
u -= (region.originalHeight - region.offsetY - region.height) / textureWidth;

View File

@@ -1,408 +0,0 @@
/** Player **/
.spine-player {
box-sizing: border-box;
width: 100%;
height: 100%;
background: none;
position: relative;
}
.spine-player * {
box-sizing: border-box;
font-family: "PT Sans",Arial,"Helvetica Neue",Helvetica,Tahoma,sans-serif;
color: #dddddd;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.spine-player-error {
font-size: 14px;
display: flex;
justify-content: center;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: black;
z-index: 10;
border-radius: 4px;
overflow: auto;
}
.spine-player-hidden {
display: none;
}
/** Slider **/
.spine-player-slider {
width: 100%;
height: 16px;
position: relative;
cursor: pointer;
}
.spine-player-slider-value {
position: absolute;
bottom: 0;
height: 2px;
background: rgba(98, 176, 238, 0.6);
cursor: pointer;
}
.spine-player-slider:hover .spine-player-slider-value {
height: 4px;
background: rgba(98, 176, 238, 1);
transition: height 0.2s;
}
.spine-player-slider-value.hovering {
height: 4px;
background: rgba(98, 176, 238, 1);
transition: height 0.2s;
}
.spine-player-slider.big {
height: 12px;
background: rgb(0, 0, 0);
}
.spine-player-slider.big .spine-player-slider-value {
height: 12px;
background: rgba(98, 176, 238, 1);
}
/** Column and row layout elements **/
.spine-player-column {
display: flex;
flex-direction: column;
}
.spine-player-row {
display: flex;
flex-direction: row;
}
/** List **/
.spine-player-list {
list-style: none !important;
padding: 0 !important;
margin: 0 !important;
}
.spine-player-list li {
cursor: pointer;
margin: 8px 8px;
}
.spine-player-list .selectable {
display: flex;
flex-direction: row;
margin: 0 !important;
padding: 2px 20px 2px 0 !important;
}
.spine-player-list li.selectable:first-child {
margin-top: 4px !important;
}
.spine-player-list li.selectable:last-child {
margin-bottom: 4px !important;
}
.spine-player-list li.selectable:hover {
background: #6e6e6e;
}
.spine-player-list li.selectable .selectable-circle {
display: flex;
flex-direction: row;
width: 6px;
min-width: 6px;
height: 6px;
border-radius: 50%;
background: #fff;
align-self: center;
opacity: 0;
margin: 5px 10px;
}
.spine-player-list li.selectable.selected .selectable-circle {
opacity: 1;
}
.spine-player-list li.selectable .selectable-text {
color: #aaa;
}
.spine-player-list li.selectable.selected .selectable-text, .spine-player-list li.selectable:hover .selectable-text {
color: #ddd;
}
/** Switch **/
.spine-player-switch {
display: flex;
flex-direction: row;
margin: 2px 10px;
}
.spine-player-switch-text {
flex: 1;
margin-right: 8px;
}
.spine-player-switch-knob-area {
width: 30px; /* width of the switch */
height: 10px;
display: block;
border-radius: 5px; /* must be half of height */
background: #6e6e6e;
position: relative;
align-self: center;
justify-self: flex-end;
}
.spine-player-switch.active .spine-player-switch-knob-area {
background: #5EAFF1;
}
.spine-player-switch-knob {
display: block;
width: 14px;
height: 14px;
border-radius: 50%;
background: #9e9e9e;
position: absolute;
left: 0px;
top: -2px;
filter: drop-shadow(0 0 1px #333);
transition: transform 0.2s;
}
.spine-player-switch.active .spine-player-switch-knob {
background: #fff;
transform: translateX(18px);
transition: transform 0.2s;
}
/** Popup **/
.spine-player-popup-parent {
position: relative;
}
.spine-player-popup {
user-select: none;
position: absolute;
background: rgba(0, 0, 0, 0.75);
z-index: 1;
right: 2px;
bottom: 40px;
border-radius: 4px;
max-height: 400%;
overflow: auto;
font-size: 85%;
}
.spine-player-popup-title {
margin: 4px 15px 2px 15px;
text-align: center;
}
.spine-player-popup hr {
margin: 0;
border: 0;
border-bottom: 1px solid #cccccc70;
}
/** Canvas **/
.spine-player canvas {
display: block;
width: 100%;
height: 100%;
border-radius: 4px;
}
/** Player controls **/
.spine-player-controls {
display: flex;
flex-direction: column;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
opacity: 1;
transition: opacity 0.4s;
}
.spine-player-controls-hidden {
pointer-events: none;
opacity: 0;
transition: opacity 0.4s;
}
/** Player buttons **/
.spine-player-buttons {
display: flex;
flex-direction: row;
width: 100%;
background: rgba(0, 0, 0, 0.5);
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
padding: 2px 8px 3px;
}
.spine-player-button {
background: none;
outline: 0;
border: none;
width: 32px;
height: 32px;
background-size: 20px;
background-repeat: no-repeat;
background-position: center;
cursor: pointer;
margin-right: 3px;
padding-bottom: 3px;
filter: drop-shadow(0 0 1px #333);
}
.spine-player-button-spacer {
flex: 1;
}
.spine-player-button-icon-play {
background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill%3A%23fff%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Eplay%3C%2Ftitle%3E%3Cg%20id%3D%22play%22%3E%3Cpolygon%20class%3D%22cls-1%22%20points%3D%2243%2023.3%204%2047%204%201%2043%2023.3%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
}
.spine-player-button-icon-play:hover {
background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill%3A%2362B0EE%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Eplay%3C%2Ftitle%3E%3Cg%20id%3D%22play%22%3E%3Cpolygon%20class%3D%22cls-1%22%20points%3D%2243%2023.3%204%2047%204%201%2043%2023.3%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
}
.spine-player-button-icon-play-selected {
background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill%3A%2362B0EE%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Eplay%3C%2Ftitle%3E%3Cg%20id%3D%22play%22%3E%3Cpolygon%20class%3D%22cls-1%22%20points%3D%2243%2023.3%204%2047%204%201%2043%2023.3%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
}
.spine-player-button-icon-pause {
background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill%3A%23fff%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Epause%3C%2Ftitle%3E%3Cg%20id%3D%22pause%22%3E%3Crect%20class%3D%22cls-1%22%20x%3D%226%22%20y%3D%221%22%20width%3D%2213%22%20height%3D%2246%22%2F%3E%3Crect%20class%3D%22cls-1%22%20x%3D%2228%22%20y%3D%221%22%20width%3D%2213%22%20height%3D%2246%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
}
.spine-player-button-icon-pause:hover {
background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill%3A%2362B0EE%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Epause%3C%2Ftitle%3E%3Cg%20id%3D%22pause%22%3E%3Crect%20class%3D%22cls-1%22%20x%3D%226%22%20y%3D%221%22%20width%3D%2213%22%20height%3D%2246%22%2F%3E%3Crect%20class%3D%22cls-1%22%20x%3D%2228%22%20y%3D%221%22%20width%3D%2213%22%20height%3D%2246%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
}
.spine-player-button-icon-pause-selected {
background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill%3A%2362B0EE%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Epause%3C%2Ftitle%3E%3Cg%20id%3D%22pause%22%3E%3Crect%20class%3D%22cls-1%22%20x%3D%226%22%20y%3D%221%22%20width%3D%2213%22%20height%3D%2246%22%2F%3E%3Crect%20class%3D%22cls-1%22%20x%3D%2228%22%20y%3D%221%22%20width%3D%2213%22%20height%3D%2246%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
}
.spine-player-button-icon-speed {
background-image: url("data:image/svg+xml,%3Csvg%20id%3D%22playback%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill%3A%23fff%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Eplayback%3C%2Ftitle%3E%3Cpath%20class%3D%22cls-1%22%20d%3D%22M48%2C28V20l-4.7-1.18a20.16%2C20.16%2C0%2C0%2C0-2-4.81l2.49-4.15L38.14%2C4.2%2C34%2C6.69a20.16%2C20.16%2C0%2C0%2C0-4.81-2L28%2C0H20L18.82%2C4.7A20.16%2C20.16%2C0%2C0%2C0%2C14%2C6.7L9.86%2C4.2%2C4.2%2C9.86%2C6.69%2C14a20.16%2C20.16%2C0%2C0%2C0-2%2C4.81L0%2C20v8l4.7%2C1.18A20.16%2C20.16%2C0%2C0%2C0%2C6.7%2C34L4.2%2C38.14%2C9.86%2C43.8%2C14%2C41.31a20.16%2C20.16%2C0%2C0%2C0%2C4.81%2C2L20%2C48h8l1.18-4.7a20.16%2C20.16%2C0%2C0%2C0%2C4.81-2l4.15%2C2.49%2C5.66-5.66L41.31%2C34a20.16%2C20.16%2C0%2C0%2C0%2C2-4.81ZM24%2C38A14%2C14%2C0%2C1%2C1%2C38%2C24%2C14%2C14%2C0%2C0%2C1%2C24%2C38Z%22%2F%3E%3Cpolygon%20class%3D%22cls-1%22%20points%3D%2234%2024%2018%2033%2018%2015%2034%2024%2034%2024%22%2F%3E%3C%2Fsvg%3E");
}
.spine-player-button-icon-speed:hover {
background-image: url("data:image/svg+xml,%3Csvg%20id%3D%22playback%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill%3A%2362B0EE%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Eplayback%3C%2Ftitle%3E%3Cpath%20class%3D%22cls-1%22%20d%3D%22M48%2C28V20l-4.7-1.18a20.16%2C20.16%2C0%2C0%2C0-2-4.81l2.49-4.15L38.14%2C4.2%2C34%2C6.69a20.16%2C20.16%2C0%2C0%2C0-4.81-2L28%2C0H20L18.82%2C4.7A20.16%2C20.16%2C0%2C0%2C0%2C14%2C6.7L9.86%2C4.2%2C4.2%2C9.86%2C6.69%2C14a20.16%2C20.16%2C0%2C0%2C0-2%2C4.81L0%2C20v8l4.7%2C1.18A20.16%2C20.16%2C0%2C0%2C0%2C6.7%2C34L4.2%2C38.14%2C9.86%2C43.8%2C14%2C41.31a20.16%2C20.16%2C0%2C0%2C0%2C4.81%2C2L20%2C48h8l1.18-4.7a20.16%2C20.16%2C0%2C0%2C0%2C4.81-2l4.15%2C2.49%2C5.66-5.66L41.31%2C34a20.16%2C20.16%2C0%2C0%2C0%2C2-4.81ZM24%2C38A14%2C14%2C0%2C1%2C1%2C38%2C24%2C14%2C14%2C0%2C0%2C1%2C24%2C38Z%22%2F%3E%3Cpolygon%20class%3D%22cls-1%22%20points%3D%2234%2024%2018%2033%2018%2015%2034%2024%2034%2024%22%2F%3E%3C%2Fsvg%3E");
}
.spine-player-button-icon-speed-selected {
background-image: url("data:image/svg+xml,%3Csvg%20id%3D%22playback%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill%3A%2362B0EE%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Eplayback%3C%2Ftitle%3E%3Cpath%20class%3D%22cls-1%22%20d%3D%22M48%2C28V20l-4.7-1.18a20.16%2C20.16%2C0%2C0%2C0-2-4.81l2.49-4.15L38.14%2C4.2%2C34%2C6.69a20.16%2C20.16%2C0%2C0%2C0-4.81-2L28%2C0H20L18.82%2C4.7A20.16%2C20.16%2C0%2C0%2C0%2C14%2C6.7L9.86%2C4.2%2C4.2%2C9.86%2C6.69%2C14a20.16%2C20.16%2C0%2C0%2C0-2%2C4.81L0%2C20v8l4.7%2C1.18A20.16%2C20.16%2C0%2C0%2C0%2C6.7%2C34L4.2%2C38.14%2C9.86%2C43.8%2C14%2C41.31a20.16%2C20.16%2C0%2C0%2C0%2C4.81%2C2L20%2C48h8l1.18-4.7a20.16%2C20.16%2C0%2C0%2C0%2C4.81-2l4.15%2C2.49%2C5.66-5.66L41.31%2C34a20.16%2C20.16%2C0%2C0%2C0%2C2-4.81ZM24%2C38A14%2C14%2C0%2C1%2C1%2C38%2C24%2C14%2C14%2C0%2C0%2C1%2C24%2C38Z%22%2F%3E%3Cpolygon%20class%3D%22cls-1%22%20points%3D%2234%2024%2018%2033%2018%2015%2034%2024%2034%2024%22%2F%3E%3C%2Fsvg%3E");
}
.spine-player-button-icon-animations {
background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill%3A%23fff%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Eanimations%3C%2Ftitle%3E%3Cg%20id%3D%22animations%22%3E%3Cpath%20class%3D%22cls-1%22%20d%3D%22M12%2C45V43.22a6.39%2C6.39%2C0%2C0%2C0%2C.63-.81%2C27.83%2C27.83%2C0%2C0%2C1%2C3.79-4.16c.93-.84%2C2.06-1.88%2C2.86-2.71a13.83%2C13.83%2C0%2C0%2C0%2C1.53-1.9l3.9-5.24c1-1.17.95-1.1%2C2.11%2C0l3%2C2.24a4%2C4%2C0%2C0%2C0-2.29%2C2.38c-1.37%2C3-2.39%2C4-2.68%2C4.22l-.23.18c-.54.39-1.81%2C1-1.7%2C1.54l.8%2C1.49a4.5%2C4.5%2C0%2C0%2C1%2C.39%2C1l.57%2C2.15a.69.69%2C0%2C0%2C0%2C.58.48c.47.08%2C1%2C.5%2C1.33.53%2C1.29.1%2C1.79%2C0%2C1.42-.54L26.7%2C42.72a.86.86%2C0%2C0%2C1-.2-.24%2C3.64%2C3.64%2C0%2C0%2C1-.42-2.2A5.39%2C5.39%2C0%2C0%2C1%2C26.61%2C39c1.84-2%2C6.74-6.36%2C6.74-6.36%2C1.71-1.81%2C1.4-2.52.81-3.84a27.38%2C27.38%2C0%2C0%2C0-2-3c-.41-.61-2.08-2.38-2.85-3.28-.43-.5.38-2.08.87-2.82.18-.12-.41.05%2C1.72.07a23.32%2C23.32%2C0%2C0%2C0%2C3.56-.19l1.63.61c.28%2C0%2C1.18-.09%2C1.31-.35l.12-.78c.18-.39.31-1.56-.05-1.75l-.6-.52a2.28%2C2.28%2C0%2C0%2C0-1.61.07l-.2.44c-.14.15-.52.37-.71.29l-2.24%2C0c-.5.12-1.18-.42-1.81-.73L32.05%2C15a8%2C8%2C0%2C0%2C0%2C.8-3.92%2C1.22%2C1.22%2C0%2C0%2C0-.28-.82%2C7.87%2C7.87%2C0%2C0%2C0-1.15-1.06l.11-.73c-.12-.49%2C1-.82%2C1.52-.82l.76-.33c.32%2C0%2C.68-.89.78-1.21L34.94%2C4a11.26%2C11.26%2C0%2C0%2C0%2C0-1.61C34.57.08%2C30.06-1.42%2C28.78%2C2c-.14.38-.62.77.34%2C3.21a1.55%2C1.55%2C0%2C0%2C1-.3%2C1.2L28.4%2C7a4%2C4%2C0%2C0%2C1-1.19.49c-.79%2C0-1.59-.75-4%2C.54C21%2C9.16%2C18.59%2C13%2C17.7%2C14.22a3.21%2C3.21%2C0%2C0%2C0-.61%2C1.58c-.05%2C1.16.7%2C3.74.87%2C5.75.13%2C1.53.21%2C2.52.72%2C3.06%2C1.07%2C1.14%2C2.1-.18%2C2.61-1a2.74%2C2.74%2C0%2C0%2C0-.14-1.86l-.74-.1c-.15-.15-.4-.42-.39-.64-.05-3.48-.22-3.14-.18-5.39%2C1.74-1.46%2C2.4-2.45%2C2.3-2-.2%2C1.15.28%2C2.83.09%2C4.35a6.46%2C6.46%2C0%2C0%2C1-.7%2C2.58s-2.11%2C4.22-2.14%2C4.27l-1.26%2C5.6-.7%2C1.44s-.71.54-1.59%2C1.21a9.67%2C9.67%2C0%2C0%2C0-2.27%2C3.18%2C20.16%2C20.16%2C0%2C0%2C1-1.42%2C2.83l-.87%2C1.31a1.72%2C1.72%2C0%2C0%2C1-.6.61l-1.83%2C1.1a1.39%2C1.39%2C0%2C0%2C0-.16.93l.68%2C1.71a4.07%2C4.07%2C0%2C0%2C1%2C.27%2C1.07l.17%2C1.56a.75.75%2C0%2C0%2C0%2C.71.59%2C18.13%2C18.13%2C0%2C0%2C0%2C3.26-.5c.27-.09-.29-.78-.53-1s-.45-.36-.45-.36A12.78%2C12.78%2C0%2C0%2C1%2C12%2C45Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")
}
.spine-player-button-icon-animations:hover {
background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill%3A%2362B0EE%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Eanimations%3C%2Ftitle%3E%3Cg%20id%3D%22animations%22%3E%3Cpath%20class%3D%22cls-1%22%20d%3D%22M12%2C45V43.22a6.39%2C6.39%2C0%2C0%2C0%2C.63-.81%2C27.83%2C27.83%2C0%2C0%2C1%2C3.79-4.16c.93-.84%2C2.06-1.88%2C2.86-2.71a13.83%2C13.83%2C0%2C0%2C0%2C1.53-1.9l3.9-5.24c1-1.17.95-1.1%2C2.11%2C0l3%2C2.24a4%2C4%2C0%2C0%2C0-2.29%2C2.38c-1.37%2C3-2.39%2C4-2.68%2C4.22l-.23.18c-.54.39-1.81%2C1-1.7%2C1.54l.8%2C1.49a4.5%2C4.5%2C0%2C0%2C1%2C.39%2C1l.57%2C2.15a.69.69%2C0%2C0%2C0%2C.58.48c.47.08%2C1%2C.5%2C1.33.53%2C1.29.1%2C1.79%2C0%2C1.42-.54L26.7%2C42.72a.86.86%2C0%2C0%2C1-.2-.24%2C3.64%2C3.64%2C0%2C0%2C1-.42-2.2A5.39%2C5.39%2C0%2C0%2C1%2C26.61%2C39c1.84-2%2C6.74-6.36%2C6.74-6.36%2C1.71-1.81%2C1.4-2.52.81-3.84a27.38%2C27.38%2C0%2C0%2C0-2-3c-.41-.61-2.08-2.38-2.85-3.28-.43-.5.38-2.08.87-2.82.18-.12-.41.05%2C1.72.07a23.32%2C23.32%2C0%2C0%2C0%2C3.56-.19l1.63.61c.28%2C0%2C1.18-.09%2C1.31-.35l.12-.78c.18-.39.31-1.56-.05-1.75l-.6-.52a2.28%2C2.28%2C0%2C0%2C0-1.61.07l-.2.44c-.14.15-.52.37-.71.29l-2.24%2C0c-.5.12-1.18-.42-1.81-.73L32.05%2C15a8%2C8%2C0%2C0%2C0%2C.8-3.92%2C1.22%2C1.22%2C0%2C0%2C0-.28-.82%2C7.87%2C7.87%2C0%2C0%2C0-1.15-1.06l.11-.73c-.12-.49%2C1-.82%2C1.52-.82l.76-.33c.32%2C0%2C.68-.89.78-1.21L34.94%2C4a11.26%2C11.26%2C0%2C0%2C0%2C0-1.61C34.57.08%2C30.06-1.42%2C28.78%2C2c-.14.38-.62.77.34%2C3.21a1.55%2C1.55%2C0%2C0%2C1-.3%2C1.2L28.4%2C7a4%2C4%2C0%2C0%2C1-1.19.49c-.79%2C0-1.59-.75-4%2C.54C21%2C9.16%2C18.59%2C13%2C17.7%2C14.22a3.21%2C3.21%2C0%2C0%2C0-.61%2C1.58c-.05%2C1.16.7%2C3.74.87%2C5.75.13%2C1.53.21%2C2.52.72%2C3.06%2C1.07%2C1.14%2C2.1-.18%2C2.61-1a2.74%2C2.74%2C0%2C0%2C0-.14-1.86l-.74-.1c-.15-.15-.4-.42-.39-.64-.05-3.48-.22-3.14-.18-5.39%2C1.74-1.46%2C2.4-2.45%2C2.3-2-.2%2C1.15.28%2C2.83.09%2C4.35a6.46%2C6.46%2C0%2C0%2C1-.7%2C2.58s-2.11%2C4.22-2.14%2C4.27l-1.26%2C5.6-.7%2C1.44s-.71.54-1.59%2C1.21a9.67%2C9.67%2C0%2C0%2C0-2.27%2C3.18%2C20.16%2C20.16%2C0%2C0%2C1-1.42%2C2.83l-.87%2C1.31a1.72%2C1.72%2C0%2C0%2C1-.6.61l-1.83%2C1.1a1.39%2C1.39%2C0%2C0%2C0-.16.93l.68%2C1.71a4.07%2C4.07%2C0%2C0%2C1%2C.27%2C1.07l.17%2C1.56a.75.75%2C0%2C0%2C0%2C.71.59%2C18.13%2C18.13%2C0%2C0%2C0%2C3.26-.5c.27-.09-.29-.78-.53-1s-.45-.36-.45-.36A12.78%2C12.78%2C0%2C0%2C1%2C12%2C45Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")
}
.spine-player-button-icon-animations-selected {
background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill%3A%2362B0EE%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Eanimations%3C%2Ftitle%3E%3Cg%20id%3D%22animations%22%3E%3Cpath%20class%3D%22cls-1%22%20d%3D%22M12%2C45V43.22a6.39%2C6.39%2C0%2C0%2C0%2C.63-.81%2C27.83%2C27.83%2C0%2C0%2C1%2C3.79-4.16c.93-.84%2C2.06-1.88%2C2.86-2.71a13.83%2C13.83%2C0%2C0%2C0%2C1.53-1.9l3.9-5.24c1-1.17.95-1.1%2C2.11%2C0l3%2C2.24a4%2C4%2C0%2C0%2C0-2.29%2C2.38c-1.37%2C3-2.39%2C4-2.68%2C4.22l-.23.18c-.54.39-1.81%2C1-1.7%2C1.54l.8%2C1.49a4.5%2C4.5%2C0%2C0%2C1%2C.39%2C1l.57%2C2.15a.69.69%2C0%2C0%2C0%2C.58.48c.47.08%2C1%2C.5%2C1.33.53%2C1.29.1%2C1.79%2C0%2C1.42-.54L26.7%2C42.72a.86.86%2C0%2C0%2C1-.2-.24%2C3.64%2C3.64%2C0%2C0%2C1-.42-2.2A5.39%2C5.39%2C0%2C0%2C1%2C26.61%2C39c1.84-2%2C6.74-6.36%2C6.74-6.36%2C1.71-1.81%2C1.4-2.52.81-3.84a27.38%2C27.38%2C0%2C0%2C0-2-3c-.41-.61-2.08-2.38-2.85-3.28-.43-.5.38-2.08.87-2.82.18-.12-.41.05%2C1.72.07a23.32%2C23.32%2C0%2C0%2C0%2C3.56-.19l1.63.61c.28%2C0%2C1.18-.09%2C1.31-.35l.12-.78c.18-.39.31-1.56-.05-1.75l-.6-.52a2.28%2C2.28%2C0%2C0%2C0-1.61.07l-.2.44c-.14.15-.52.37-.71.29l-2.24%2C0c-.5.12-1.18-.42-1.81-.73L32.05%2C15a8%2C8%2C0%2C0%2C0%2C.8-3.92%2C1.22%2C1.22%2C0%2C0%2C0-.28-.82%2C7.87%2C7.87%2C0%2C0%2C0-1.15-1.06l.11-.73c-.12-.49%2C1-.82%2C1.52-.82l.76-.33c.32%2C0%2C.68-.89.78-1.21L34.94%2C4a11.26%2C11.26%2C0%2C0%2C0%2C0-1.61C34.57.08%2C30.06-1.42%2C28.78%2C2c-.14.38-.62.77.34%2C3.21a1.55%2C1.55%2C0%2C0%2C1-.3%2C1.2L28.4%2C7a4%2C4%2C0%2C0%2C1-1.19.49c-.79%2C0-1.59-.75-4%2C.54C21%2C9.16%2C18.59%2C13%2C17.7%2C14.22a3.21%2C3.21%2C0%2C0%2C0-.61%2C1.58c-.05%2C1.16.7%2C3.74.87%2C5.75.13%2C1.53.21%2C2.52.72%2C3.06%2C1.07%2C1.14%2C2.1-.18%2C2.61-1a2.74%2C2.74%2C0%2C0%2C0-.14-1.86l-.74-.1c-.15-.15-.4-.42-.39-.64-.05-3.48-.22-3.14-.18-5.39%2C1.74-1.46%2C2.4-2.45%2C2.3-2-.2%2C1.15.28%2C2.83.09%2C4.35a6.46%2C6.46%2C0%2C0%2C1-.7%2C2.58s-2.11%2C4.22-2.14%2C4.27l-1.26%2C5.6-.7%2C1.44s-.71.54-1.59%2C1.21a9.67%2C9.67%2C0%2C0%2C0-2.27%2C3.18%2C20.16%2C20.16%2C0%2C0%2C1-1.42%2C2.83l-.87%2C1.31a1.72%2C1.72%2C0%2C0%2C1-.6.61l-1.83%2C1.1a1.39%2C1.39%2C0%2C0%2C0-.16.93l.68%2C1.71a4.07%2C4.07%2C0%2C0%2C1%2C.27%2C1.07l.17%2C1.56a.75.75%2C0%2C0%2C0%2C.71.59%2C18.13%2C18.13%2C0%2C0%2C0%2C3.26-.5c.27-.09-.29-.78-.53-1s-.45-.36-.45-.36A12.78%2C12.78%2C0%2C0%2C1%2C12%2C45Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")
}
.spine-player-button-icon-skins {
background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill%3A%23fff%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Eskins%3C%2Ftitle%3E%3Cg%20id%3D%22skins%22%3E%3Cpath%20class%3D%22cls-1%22%20d%3D%22M36%2C12.54l-6.92%2C1-.79%2C1.2c-1%2C.25-2-.62-3-.55V12.33a1.35%2C1.35%2C0%2C0%2C1%2C.55-1.07c3-2.24%2C3.28-3.75%2C3.28-5.34A5.06%2C5.06%2C0%2C0%2C0%2C24%2C.76c-2.54%2C0-4.38.71-5.49%2C2.13a5.74%2C5.74%2C0%2C0%2C0-.9%2C4.57l2.48-.61a3.17%2C3.17%2C0%2C0%2C1%2C.45-2.4c.6-.75%2C1.75-1.13%2C3.42-1.13%2C2.56%2C0%2C2.56%2C1.24%2C2.56%2C2.56%2C0%2C.92%2C0%2C1.65-2.26%2C3.34a3.92%2C3.92%2C0%2C0%2C0-1.58%2C3.12v1.86c-1-.07-2%2C.8-3%2C.55l-.79-1.2-6.92-1c-2.25%2C0-4.35%2C2.09-5.64%2C3.93L1%2C24c3.83%2C5.11%2C10.22%2C5.11%2C10.22%2C5.11V41.93c0%2C2.34%2C2.68%2C3.88%2C5.59%2C4.86a22.59%2C22.59%2C0%2C0%2C0%2C14.37%2C0c2.91-1%2C5.59-2.52%2C5.59-4.86V29.15S43.17%2C29.15%2C47%2C24l-5.33-7.57C40.38%2C14.63%2C38.27%2C12.54%2C36%2C12.54ZM23.32%2C20.09%2C21%2C17l1.8-.6a3.79%2C3.79%2C0%2C0%2C1%2C2.4%2C0L27%2C17l-2.32%2C3.09A.85.85%2C0%2C0%2C1%2C23.32%2C20.09Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
width: 31px;
height: 31px;
}
.spine-player-button-icon-skins:hover {
background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill%3A%2362B0EE%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Eskins%3C%2Ftitle%3E%3Cg%20id%3D%22skins%22%3E%3Cpath%20class%3D%22cls-1%22%20d%3D%22M36%2C12.54l-6.92%2C1-.79%2C1.2c-1%2C.25-2-.62-3-.55V12.33a1.35%2C1.35%2C0%2C0%2C1%2C.55-1.07c3-2.24%2C3.28-3.75%2C3.28-5.34A5.06%2C5.06%2C0%2C0%2C0%2C24%2C.76c-2.54%2C0-4.38.71-5.49%2C2.13a5.74%2C5.74%2C0%2C0%2C0-.9%2C4.57l2.48-.61a3.17%2C3.17%2C0%2C0%2C1%2C.45-2.4c.6-.75%2C1.75-1.13%2C3.42-1.13%2C2.56%2C0%2C2.56%2C1.24%2C2.56%2C2.56%2C0%2C.92%2C0%2C1.65-2.26%2C3.34a3.92%2C3.92%2C0%2C0%2C0-1.58%2C3.12v1.86c-1-.07-2%2C.8-3%2C.55l-.79-1.2-6.92-1c-2.25%2C0-4.35%2C2.09-5.64%2C3.93L1%2C24c3.83%2C5.11%2C10.22%2C5.11%2C10.22%2C5.11V41.93c0%2C2.34%2C2.68%2C3.88%2C5.59%2C4.86a22.59%2C22.59%2C0%2C0%2C0%2C14.37%2C0c2.91-1%2C5.59-2.52%2C5.59-4.86V29.15S43.17%2C29.15%2C47%2C24l-5.33-7.57C40.38%2C14.63%2C38.27%2C12.54%2C36%2C12.54ZM23.32%2C20.09%2C21%2C17l1.8-.6a3.79%2C3.79%2C0%2C0%2C1%2C2.4%2C0L27%2C17l-2.32%2C3.09A.85.85%2C0%2C0%2C1%2C23.32%2C20.09Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
}
.spine-player-button-icon-skins-selected {
background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill%3A%2362B0EE%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Eskins%3C%2Ftitle%3E%3Cg%20id%3D%22skins%22%3E%3Cpath%20class%3D%22cls-1%22%20d%3D%22M36%2C12.54l-6.92%2C1-.79%2C1.2c-1%2C.25-2-.62-3-.55V12.33a1.35%2C1.35%2C0%2C0%2C1%2C.55-1.07c3-2.24%2C3.28-3.75%2C3.28-5.34A5.06%2C5.06%2C0%2C0%2C0%2C24%2C.76c-2.54%2C0-4.38.71-5.49%2C2.13a5.74%2C5.74%2C0%2C0%2C0-.9%2C4.57l2.48-.61a3.17%2C3.17%2C0%2C0%2C1%2C.45-2.4c.6-.75%2C1.75-1.13%2C3.42-1.13%2C2.56%2C0%2C2.56%2C1.24%2C2.56%2C2.56%2C0%2C.92%2C0%2C1.65-2.26%2C3.34a3.92%2C3.92%2C0%2C0%2C0-1.58%2C3.12v1.86c-1-.07-2%2C.8-3%2C.55l-.79-1.2-6.92-1c-2.25%2C0-4.35%2C2.09-5.64%2C3.93L1%2C24c3.83%2C5.11%2C10.22%2C5.11%2C10.22%2C5.11V41.93c0%2C2.34%2C2.68%2C3.88%2C5.59%2C4.86a22.59%2C22.59%2C0%2C0%2C0%2C14.37%2C0c2.91-1%2C5.59-2.52%2C5.59-4.86V29.15S43.17%2C29.15%2C47%2C24l-5.33-7.57C40.38%2C14.63%2C38.27%2C12.54%2C36%2C12.54ZM23.32%2C20.09%2C21%2C17l1.8-.6a3.79%2C3.79%2C0%2C0%2C1%2C2.4%2C0L27%2C17l-2.32%2C3.09A.85.85%2C0%2C0%2C1%2C23.32%2C20.09Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
}
.spine-player-button-icon-settings {
background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill%3A%23fff%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Esettings%3C%2Ftitle%3E%3Cg%20id%3D%22settings%22%3E%3Cpath%20class%3D%22cls-1%22%20d%3D%22M40%2C3H8A5%2C5%2C0%2C0%2C0%2C3%2C8V40a5%2C5%2C0%2C0%2C0%2C5%2C5H40a5%2C5%2C0%2C0%2C0%2C5-5V8A5%2C5%2C0%2C0%2C0%2C40%2C3ZM16%2C40H9V33h7Zm0-12H9V21h7Zm0-12H9V9h7ZM39%2C38H20V35H39Zm0-12H20V23H39Zm0-12H20V11H39Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
margin-top: 1px;
}
.spine-player-button-icon-settings:hover {
background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill%3A%2362B0EE%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Esettings%3C%2Ftitle%3E%3Cg%20id%3D%22settings%22%3E%3Cpath%20class%3D%22cls-1%22%20d%3D%22M40%2C3H8A5%2C5%2C0%2C0%2C0%2C3%2C8V40a5%2C5%2C0%2C0%2C0%2C5%2C5H40a5%2C5%2C0%2C0%2C0%2C5-5V8A5%2C5%2C0%2C0%2C0%2C40%2C3ZM16%2C40H9V33h7Zm0-12H9V21h7Zm0-12H9V9h7ZM39%2C38H20V35H39Zm0-12H20V23H39Zm0-12H20V11H39Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
}
.spine-player-button-icon-settings-selected {
background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill%3A%2362B0EE%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Esettings%3C%2Ftitle%3E%3Cg%20id%3D%22settings%22%3E%3Cpath%20class%3D%22cls-1%22%20d%3D%22M40%2C3H8A5%2C5%2C0%2C0%2C0%2C3%2C8V40a5%2C5%2C0%2C0%2C0%2C5%2C5H40a5%2C5%2C0%2C0%2C0%2C5-5V8A5%2C5%2C0%2C0%2C0%2C40%2C3ZM16%2C40H9V33h7Zm0-12H9V21h7Zm0-12H9V9h7ZM39%2C38H20V35H39Zm0-12H20V23H39Zm0-12H20V11H39Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
}
.spine-player-button-icon-fullscreen {
background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill%3A%23fff%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Eexpand%3C%2Ftitle%3E%3Cg%20id%3D%22settings%22%3E%3Cpolygon%20class%3D%22cls-1%22%20points%3D%2230.14%208%2040%208%2040%2017.86%2044.5%2017.86%2044.5%203.5%2030.14%203.5%2030.14%208%22%2F%3E%3Cpolygon%20class%3D%22cls-1%22%20points%3D%228%2017.86%208%208%2017.86%208%2017.86%203.5%203.5%203.5%203.5%2017.86%208%2017.86%22%2F%3E%3Cpolygon%20class%3D%22cls-1%22%20points%3D%2240%2030.14%2040%2040%2030.14%2040%2030.14%2044.5%2044.5%2044.5%2044.5%2030.14%2040%2030.14%22%2F%3E%3Cpolygon%20class%3D%22cls-1%22%20points%3D%2217.86%2040%208%2040%208%2030.14%203.5%2030.14%203.5%2044.5%2017.86%2044.5%2017.86%2040%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
margin-top: 1px;
}
.spine-player-button-icon-fullscreen:hover {
background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill%3A%2362B0EE%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Eexpand%3C%2Ftitle%3E%3Cg%20id%3D%22settings%22%3E%3Cpolygon%20class%3D%22cls-1%22%20points%3D%2230.14%208%2040%208%2040%2017.86%2044.5%2017.86%2044.5%203.5%2030.14%203.5%2030.14%208%22%2F%3E%3Cpolygon%20class%3D%22cls-1%22%20points%3D%228%2017.86%208%208%2017.86%208%2017.86%203.5%203.5%203.5%203.5%2017.86%208%2017.86%22%2F%3E%3Cpolygon%20class%3D%22cls-1%22%20points%3D%2240%2030.14%2040%2040%2030.14%2040%2030.14%2044.5%2044.5%2044.5%2044.5%2030.14%2040%2030.14%22%2F%3E%3Cpolygon%20class%3D%22cls-1%22%20points%3D%2217.86%2040%208%2040%208%2030.14%203.5%2030.14%203.5%2044.5%2017.86%2044.5%2017.86%2040%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
}
.spine-player-button-icon-fullscreen-selected {
background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill%3A%2362B0EE%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Eexpand%3C%2Ftitle%3E%3Cg%20id%3D%22settings%22%3E%3Cpolygon%20class%3D%22cls-1%22%20points%3D%2230.14%208%2040%208%2040%2017.86%2044.5%2017.86%2044.5%203.5%2030.14%203.5%2030.14%208%22%2F%3E%3Cpolygon%20class%3D%22cls-1%22%20points%3D%228%2017.86%208%208%2017.86%208%2017.86%203.5%203.5%203.5%203.5%2017.86%208%2017.86%22%2F%3E%3Cpolygon%20class%3D%22cls-1%22%20points%3D%2240%2030.14%2040%2040%2030.14%2040%2030.14%2044.5%2044.5%2044.5%2044.5%2030.14%2040%2030.14%22%2F%3E%3Cpolygon%20class%3D%22cls-1%22%20points%3D%2217.86%2040%208%2040%208%2030.14%203.5%2030.14%203.5%2044.5%2017.86%2044.5%2017.86%2040%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
}
.spine-player-button-icon-spine-logo {
height: 20px;
position: relative;
top: 1px;
margin: 0 8px !important;
align-self: center;
border: none !important;
width: auto !important;
cursor: pointer;
transition: transform 0.2s;
box-shadow: none !important;
filter: drop-shadow(0 0 1px #333);
}
.spine-player-button-icon-spine-logo:hover {
transform: scale(1.05);
transition: transform 0.2s;
}
/** Speed slider **/
.spine-player-speed-slider {
width: 150px;
}
/** Player editor **/
.spine-player-editor-container {
display: flex;
flex-direction: row;
height: 100%;
width: 100%;
}
.spine-player-editor-code {
flex: 1;
overflow: auto;
}
.CodeMirror {
height: 100%;
}
.spine-player-editor-player {
flex: 1;
border: none;
background: black;
}

View File

@@ -1,272 +0,0 @@
raptor-pma.png
size: 1024,512
format: RGBA8888
filter: Linear,Linear
repeat: none
back-arm
rotate: true
xy: 829, 88
size: 46, 25
orig: 46, 25
offset: 0, 0
index: -1
back-bracer
rotate: true
xy: 195, 238
size: 39, 28
orig: 39, 28
offset: 0, 0
index: -1
back-hand
rotate: true
xy: 724, 140
size: 36, 34
orig: 36, 34
offset: 0, 0
index: -1
back-knee
rotate: true
xy: 760, 131
size: 49, 67
orig: 49, 67
offset: 0, 0
index: -1
back-thigh
rotate: true
xy: 225, 238
size: 39, 24
orig: 39, 24
offset: 0, 0
index: -1
eyes-open
rotate: false
xy: 975, 204
size: 47, 45
orig: 47, 45
offset: 0, 0
index: -1
front-arm
rotate: false
xy: 969, 112
size: 48, 26
orig: 48, 26
offset: 0, 0
index: -1
front-bracer
rotate: true
xy: 724, 97
size: 41, 29
orig: 41, 29
offset: 0, 0
index: -1
front-hand
rotate: false
xy: 251, 239
size: 41, 38
orig: 41, 38
offset: 0, 0
index: -1
front-open-hand
rotate: true
xy: 856, 76
size: 43, 44
orig: 43, 44
offset: 0, 0
index: -1
front-thigh
rotate: true
xy: 729, 178
size: 57, 29
orig: 57, 29
offset: 0, 0
index: -1
gun
rotate: false
xy: 894, 251
size: 107, 103
orig: 107, 103
offset: 0, 0
index: -1
gun-nohand
rotate: false
xy: 764, 241
size: 105, 102
orig: 105, 102
offset: 0, 0
index: -1
head
rotate: false
xy: 756, 345
size: 136, 149
orig: 136, 149
offset: 0, 0
index: -1
lower-leg
rotate: true
xy: 475, 237
size: 73, 98
orig: 73, 98
offset: 0, 0
index: -1
mouth-grind
rotate: false
xy: 975, 172
size: 47, 30
orig: 47, 30
offset: 0, 0
index: -1
mouth-smile
rotate: false
xy: 975, 140
size: 47, 30
orig: 47, 30
offset: 0, 0
index: -1
neck
rotate: false
xy: 366, 282
size: 18, 21
orig: 18, 21
offset: 0, 0
index: -1
raptor-back-arm
rotate: true
xy: 636, 97
size: 82, 86
orig: 82, 86
offset: 0, 0
index: -1
raptor-body
rotate: false
xy: 2, 2
size: 632, 233
orig: 632, 233
offset: 0, 0
index: -1
raptor-front-arm
rotate: true
xy: 871, 168
size: 81, 102
orig: 81, 102
offset: 0, 0
index: -1
raptor-front-leg
rotate: false
xy: 2, 237
size: 191, 257
orig: 191, 257
offset: 0, 0
index: -1
raptor-hindleg-back
rotate: false
xy: 195, 279
size: 169, 215
orig: 169, 215
offset: 0, 0
index: -1
raptor-horn
rotate: true
xy: 431, 312
size: 182, 80
orig: 182, 80
offset: 0, 0
index: -1
raptor-horn-back
rotate: true
xy: 513, 318
size: 176, 77
orig: 176, 77
offset: 0, 0
index: -1
raptor-jaw
rotate: false
xy: 894, 356
size: 126, 138
orig: 126, 138
offset: 0, 0
index: -1
raptor-jaw-tooth
rotate: true
xy: 294, 240
size: 37, 48
orig: 37, 48
offset: 0, 0
index: -1
raptor-mouth-inside
rotate: true
xy: 344, 241
size: 36, 41
orig: 36, 41
offset: 0, 0
index: -1
raptor-saddle-strap-back
rotate: false
xy: 575, 242
size: 54, 74
orig: 54, 74
offset: 0, 0
index: -1
raptor-saddle-strap-front
rotate: true
xy: 764, 182
size: 57, 95
orig: 57, 95
offset: 0, 0
index: -1
raptor-saddle-w-shadow
rotate: false
xy: 592, 323
size: 162, 171
orig: 162, 171
offset: 0, 0
index: -1
raptor-tail-shadow
rotate: true
xy: 366, 305
size: 189, 63
orig: 189, 63
offset: 0, 0
index: -1
raptor-tongue
rotate: false
xy: 387, 239
size: 86, 64
orig: 86, 64
offset: 0, 0
index: -1
stirrup-back
rotate: true
xy: 829, 136
size: 44, 35
orig: 44, 35
offset: 0, 0
index: -1
stirrup-front
rotate: true
xy: 866, 121
size: 45, 50
orig: 45, 50
offset: 0, 0
index: -1
stirrup-strap
rotate: false
xy: 918, 120
size: 49, 46
orig: 49, 46
offset: 0, 0
index: -1
torso
rotate: true
xy: 636, 181
size: 54, 91
orig: 54, 91
offset: 0, 0
index: -1
visor
rotate: false
xy: 631, 237
size: 131, 84
orig: 131, 84
offset: 0, 0
index: -1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 469 KiB

File diff suppressed because one or more lines are too long

View File

@@ -1,286 +0,0 @@
spineboy-pma.png
size: 1024,256
format: RGBA8888
filter: Linear,Linear
repeat: none
crosshair
rotate: false
xy: 813, 160
size: 45, 45
orig: 45, 45
offset: 0, 0
index: -1
eye-indifferent
rotate: false
xy: 569, 2
size: 47, 45
orig: 47, 45
offset: 0, 0
index: -1
eye-surprised
rotate: true
xy: 643, 7
size: 47, 45
orig: 47, 45
offset: 0, 0
index: -1
front-bracer
rotate: false
xy: 811, 51
size: 29, 40
orig: 29, 40
offset: 0, 0
index: -1
front-fist-closed
rotate: false
xy: 807, 93
size: 38, 41
orig: 38, 41
offset: 0, 0
index: -1
front-fist-open
rotate: false
xy: 815, 210
size: 43, 44
orig: 43, 44
offset: 0, 0
index: -1
front-foot
rotate: true
xy: 706, 64
size: 63, 35
orig: 63, 35
offset: 0, 0
index: -1
front-shin
rotate: false
xy: 80, 11
size: 41, 92
orig: 41, 92
offset: 0, 0
index: -1
front-thigh
rotate: false
xy: 754, 12
size: 23, 56
orig: 23, 56
offset: 0, 0
index: -1
front-upper-arm
rotate: false
xy: 618, 5
size: 23, 49
orig: 23, 49
offset: 0, 0
index: -1
goggles
rotate: false
xy: 214, 20
size: 131, 83
orig: 131, 83
offset: 0, 0
index: -1
gun
rotate: true
xy: 347, 14
size: 105, 102
orig: 105, 102
offset: 0, 0
index: -1
head
rotate: false
xy: 80, 105
size: 136, 149
orig: 136, 149
offset: 0, 0
index: -1
hoverboard-board
rotate: true
xy: 2, 8
size: 246, 76
orig: 246, 76
offset: 0, 0
index: -1
hoverboard-thruster
rotate: false
xy: 478, 2
size: 30, 32
orig: 30, 32
offset: 0, 0
index: -1
hoverglow-small
rotate: true
xy: 218, 117
size: 137, 38
orig: 137, 38
offset: 0, 0
index: -1
mouth-grind
rotate: true
xy: 775, 80
size: 47, 30
orig: 47, 30
offset: 0, 0
index: -1
mouth-oooo
rotate: true
xy: 779, 31
size: 47, 30
orig: 47, 30
offset: 0, 0
index: -1
mouth-smile
rotate: true
xy: 783, 207
size: 47, 30
orig: 47, 30
offset: 0, 0
index: -1
muzzle-glow
rotate: false
xy: 779, 4
size: 25, 25
orig: 25, 25
offset: 0, 0
index: -1
muzzle-ring
rotate: false
xy: 451, 14
size: 25, 105
orig: 25, 105
offset: 0, 0
index: -1
muzzle01
rotate: true
xy: 664, 60
size: 67, 40
orig: 67, 40
offset: 0, 0
index: -1
muzzle02
rotate: true
xy: 580, 56
size: 68, 42
orig: 68, 42
offset: 0, 0
index: -1
muzzle03
rotate: true
xy: 478, 36
size: 83, 53
orig: 83, 53
offset: 0, 0
index: -1
muzzle04
rotate: true
xy: 533, 49
size: 75, 45
orig: 75, 45
offset: 0, 0
index: -1
muzzle05
rotate: true
xy: 624, 56
size: 68, 38
orig: 68, 38
offset: 0, 0
index: -1
neck
rotate: false
xy: 806, 8
size: 18, 21
orig: 18, 21
offset: 0, 0
index: -1
portal-bg
rotate: false
xy: 258, 121
size: 133, 133
orig: 133, 133
offset: 0, 0
index: -1
portal-flare1
rotate: true
xy: 690, 2
size: 56, 30
orig: 56, 30
offset: 0, 0
index: -1
portal-flare2
rotate: false
xy: 510, 3
size: 57, 31
orig: 57, 31
offset: 0, 0
index: -1
portal-flare3
rotate: true
xy: 722, 4
size: 58, 30
orig: 58, 30
offset: 0, 0
index: -1
portal-shade
rotate: false
xy: 393, 121
size: 133, 133
orig: 133, 133
offset: 0, 0
index: -1
portal-streaks1
rotate: false
xy: 528, 126
size: 126, 128
orig: 126, 128
offset: 0, 0
index: -1
portal-streaks2
rotate: false
xy: 656, 129
size: 125, 125
orig: 125, 125
offset: 0, 0
index: -1
rear-bracer
rotate: false
xy: 826, 13
size: 28, 36
orig: 28, 36
offset: 0, 0
index: -1
rear-foot
rotate: true
xy: 743, 70
size: 57, 30
orig: 57, 30
offset: 0, 0
index: -1
rear-shin
rotate: false
xy: 174, 14
size: 38, 89
orig: 38, 89
offset: 0, 0
index: -1
rear-thigh
rotate: false
xy: 783, 158
size: 28, 47
orig: 28, 47
offset: 0, 0
index: -1
rear-upper-arm
rotate: true
xy: 783, 136
size: 20, 44
orig: 20, 44
offset: 0, 0
index: -1
torso
rotate: false
xy: 123, 13
size: 49, 90
orig: 49, 90
offset: 0, 0
index: -1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 264 KiB

View File

@@ -1,26 +0,0 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="./external/codemirror.js"></script>
<script src="../../build/spine-player.js"></script>
<link rel="stylesheet" href="../css/spine-player.css">
<link rel="stylesheet" href="./external/codemirror.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<style>
body {
background: gray;
margin: 0px;
}
</style>
<body>
<div id="editor" style="height: 700px;"></div>
</body>
<script>
new spine.SpinePlayerEditor(document.getElementById("editor"));
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,395 +0,0 @@
/* BASICS */
.CodeMirror {
/* Set height, width, borders, and global font properties here */
font-family: monospace;
height: 300px;
color: black;
direction: ltr;
}
/* PADDING */
.CodeMirror-lines {
padding: 4px 0; /* Vertical padding around content */
}
.CodeMirror pre {
padding: 0 4px; /* Horizontal padding of content */
}
.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
background-color: white; /* The little square between H and V scrollbars */
}
/* GUTTER */
.CodeMirror-gutters {
border-right: 1px solid #ddd;
background-color: #f7f7f7;
white-space: nowrap;
}
.CodeMirror-linenumbers {}
.CodeMirror-linenumber {
padding: 0 3px 0 5px;
min-width: 20px;
text-align: right;
color: #999;
white-space: nowrap;
}
.CodeMirror-guttermarker { color: black; }
.CodeMirror-guttermarker-subtle { color: #999; }
/* CURSOR */
.CodeMirror-cursor {
border-left: 1px solid black;
border-right: none;
width: 0;
}
/* Shown when moving in bi-directional text */
.CodeMirror div.CodeMirror-secondarycursor {
border-left: 1px solid silver;
}
.cm-fat-cursor .CodeMirror-cursor {
width: auto;
border: 0 !important;
background: #7e7;
}
.cm-fat-cursor div.CodeMirror-cursors {
z-index: 1;
}
.cm-fat-cursor-mark {
background-color: rgba(20, 255, 20, 0.5);
-webkit-animation: blink 1.06s steps(1) infinite;
-moz-animation: blink 1.06s steps(1) infinite;
animation: blink 1.06s steps(1) infinite;
}
.cm-animate-fat-cursor {
width: auto;
border: 0;
-webkit-animation: blink 1.06s steps(1) infinite;
-moz-animation: blink 1.06s steps(1) infinite;
animation: blink 1.06s steps(1) infinite;
background-color: #7e7;
}
@-moz-keyframes blink {
0% {}
50% { background-color: transparent; }
100% {}
}
@-webkit-keyframes blink {
0% {}
50% { background-color: transparent; }
100% {}
}
@keyframes blink {
0% {}
50% { background-color: transparent; }
100% {}
}
/* Can style cursor different in overwrite (non-insert) mode */
.CodeMirror-overwrite .CodeMirror-cursor {}
.cm-tab { display: inline-block; text-decoration: inherit; }
.CodeMirror-rulers {
position: absolute;
left: 0; right: 0; top: -50px; bottom: -20px;
overflow: hidden;
}
.CodeMirror-ruler {
border-left: 1px solid #ccc;
top: 0; bottom: 0;
position: absolute;
}
/* DEFAULT THEME */
.cm-s-default .cm-header {color: blue;}
.cm-s-default .cm-quote {color: #090;}
.cm-negative {color: #d44;}
.cm-positive {color: #292;}
.cm-header, .cm-strong {font-weight: bold;}
.cm-em {font-style: italic;}
.cm-link {text-decoration: underline;}
.cm-strikethrough {text-decoration: line-through;}
.cm-s-default .cm-keyword {color: #708;}
.cm-s-default .cm-atom {color: #219;}
.cm-s-default .cm-number {color: #164;}
.cm-s-default .cm-def {color: #00f;}
.cm-s-default .cm-variable,
.cm-s-default .cm-punctuation,
.cm-s-default .cm-property,
.cm-s-default .cm-operator {}
.cm-s-default .cm-variable-2 {color: #05a;}
.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}
.cm-s-default .cm-comment {color: #a50;}
.cm-s-default .cm-string {color: #a11;}
.cm-s-default .cm-string-2 {color: #f50;}
.cm-s-default .cm-meta {color: #555;}
.cm-s-default .cm-qualifier {color: #555;}
.cm-s-default .cm-builtin {color: #30a;}
.cm-s-default .cm-bracket {color: #997;}
.cm-s-default .cm-tag {color: #170;}
.cm-s-default .cm-attribute {color: #00c;}
.cm-s-default .cm-hr {color: #999;}
.cm-s-default .cm-link {color: #00c;}
.cm-s-default .cm-error {color: #f00;}
.cm-invalidchar {color: #f00;}
.CodeMirror-composing { border-bottom: 2px solid; }
/* Default styles for common addons */
div.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
.CodeMirror-activeline-background {background: #e8f2ff;}
/* STOP */
/* The rest of this file contains styles related to the mechanics of
the editor. You probably shouldn't touch them. */
.CodeMirror {
position: relative;
overflow: hidden;
background: white;
}
.CodeMirror-scroll {
overflow: scroll !important; /* Things will break if this is overridden */
/* 30px is the magic margin used to hide the element's real scrollbars */
/* See overflow: hidden in .CodeMirror */
margin-bottom: -30px; margin-right: -30px;
padding-bottom: 30px;
height: 100%;
outline: none; /* Prevent dragging from highlighting the element */
position: relative;
}
.CodeMirror-sizer {
position: relative;
border-right: 30px solid transparent;
}
/* The fake, visible scrollbars. Used to force redraw during scrolling
before actual scrolling happens, thus preventing shaking and
flickering artifacts. */
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
position: absolute;
z-index: 6;
display: none;
}
.CodeMirror-vscrollbar {
right: 0; top: 0;
overflow-x: hidden;
overflow-y: scroll;
}
.CodeMirror-hscrollbar {
bottom: 0; left: 0;
overflow-y: hidden;
overflow-x: scroll;
}
.CodeMirror-scrollbar-filler {
right: 0; bottom: 0;
}
.CodeMirror-gutter-filler {
left: 0; bottom: 0;
}
.CodeMirror-gutters {
position: absolute; left: 0; top: 0;
min-height: 100%;
z-index: 3;
}
.CodeMirror-gutter {
white-space: normal;
height: 100%;
display: inline-block;
vertical-align: top;
margin-bottom: -30px;
}
.CodeMirror-gutter-wrapper {
position: absolute;
z-index: 4;
background: none !important;
border: none !important;
}
.CodeMirror-gutter-background {
position: absolute;
top: 0; bottom: 0;
z-index: 4;
}
.CodeMirror-gutter-elt {
position: absolute;
cursor: default;
z-index: 4;
}
.CodeMirror-gutter-wrapper ::selection { background-color: transparent }
.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }
.CodeMirror-lines {
cursor: text;
min-height: 1px; /* prevents collapsing before first draw */
}
.CodeMirror pre {
/* Reset some styles that the rest of the page might have set */
-moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
border-width: 0;
background: transparent;
font-family: inherit;
font-size: inherit;
margin: 0;
white-space: pre;
word-wrap: normal;
line-height: inherit;
color: inherit;
z-index: 2;
position: relative;
overflow: visible;
-webkit-tap-highlight-color: transparent;
-webkit-font-variant-ligatures: contextual;
font-variant-ligatures: contextual;
}
.CodeMirror-wrap pre {
word-wrap: break-word;
white-space: pre-wrap;
word-break: normal;
}
.CodeMirror-linebackground {
position: absolute;
left: 0; right: 0; top: 0; bottom: 0;
z-index: 0;
}
.CodeMirror-linewidget {
position: relative;
z-index: 2;
padding: 0.1px; /* Force widget margins to stay inside of the container */
}
.CodeMirror-widget {}
.CodeMirror-rtl pre { direction: rtl; }
.CodeMirror-code {
outline: none;
}
/* Force content-box sizing for the elements where we expect it */
.CodeMirror-scroll,
.CodeMirror-sizer,
.CodeMirror-gutter,
.CodeMirror-gutters,
.CodeMirror-linenumber {
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.CodeMirror-measure {
position: absolute;
width: 100%;
height: 0;
overflow: hidden;
visibility: hidden;
}
.CodeMirror-cursor {
position: absolute;
pointer-events: none;
}
.CodeMirror-measure pre { position: static; }
div.CodeMirror-cursors {
visibility: hidden;
position: relative;
z-index: 3;
}
div.CodeMirror-dragcursors {
visibility: visible;
}
.CodeMirror-focused div.CodeMirror-cursors {
visibility: visible;
}
.CodeMirror-selected { background: #d9d9d9; }
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
.CodeMirror-crosshair { cursor: crosshair; }
.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }
.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }
.cm-searching {
background-color: #ffa;
background-color: rgba(255, 255, 0, .4);
}
/* Used to force a border model for a node */
.cm-force-border { padding-right: .1px; }
@media print {
/* Hide the cursor when printing */
.CodeMirror div.CodeMirror-cursors {
visibility: hidden;
}
}
/* See issue #2901 */
.cm-tab-wrap-hack:after { content: ''; }
/* Help users use markselection to safely style text background */
span.CodeMirror-selectedtext { background: none; }
.CodeMirror {
font-family: Monaco, "Courier New", monospace;
font-weight: normal;
font-size: 14px;
line-height: 18px;
letter-spacing: 0px;
height: 100%;
}
.cm-s-monokai.CodeMirror { background: #1e1e1e; color: #f8f8f2; }
.cm-s-monokai div.CodeMirror-selected { background: #464646; }
.cm-s-monokai .CodeMirror-line::selection, .cm-s-monokai .CodeMirror-line > span::selection, .cm-s-monokai .CodeMirror-line > span > span::selection { background: rgba(73, 72, 62, .99); }
.cm-s-monokai .CodeMirror-line::-moz-selection, .cm-s-monokai .CodeMirror-line > span::-moz-selection, .cm-s-monokai .CodeMirror-line > span > span::-moz-selection { background: rgba(73, 72, 62, .99); }
.cm-s-monokai .CodeMirror-gutters { background: #1e1e1e; border-right: 0px; }
.cm-s-monokai .CodeMirror-guttermarker { color: white; }
.cm-s-monokai .CodeMirror-guttermarker-subtle { color: #d0d0d0; }
.cm-s-monokai .CodeMirror-linenumber { color: #828282; }
.cm-s-monokai .CodeMirror-cursor { border-left: 1px solid #f8f8f0; }
.cm-s-monokai span.cm-comment { color: #84ea53; }
.cm-s-monokai span.cm-atom { color: #539BD8; }
.cm-s-monokai span.cm-number { color: #AFC9A2; }
.cm-s-monokai span.cm-comment.cm-attribute { color: #97b757; }
.cm-s-monokai span.cm-comment.cm-def { color: #bc9262; }
.cm-s-monokai span.cm-comment.cm-tag { color: #bc6283; }
.cm-s-monokai span.cm-comment.cm-type { color: #5998a6; }
.cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute { color: #a6e22e; }
.cm-s-monokai span.cm-keyword { color: #b97cb5; }
.cm-s-monokai span.cm-builtin { color: #b97cb5; }
.cm-s-monokai span.cm-string { color: #CA8D73; }
.cm-s-monokai span.cm-variable { color: #99D9FE; }
.cm-s-monokai span.cm-variable-2 { color: #DCDDA7; }
.cm-s-monokai span.cm-variable-3, .cm-s-monokai span.cm-type { color: #DCDDA7; }
.cm-s-monokai span.cm-def { color: #fd971f; }
.cm-s-monokai span.cm-bracket { color: #f8f8f2; }
.cm-s-monokai span.cm-tag { color: #f92672; }
.cm-s-monokai span.cm-header { color: #ae81ff; }
.cm-s-monokai span.cm-link { color: #ae81ff; }
.cm-s-monokai span.cm-error { background: #f92672; color: #f8f8f0; }
.cm-s-monokai .CodeMirror-activeline-background { background: #373831; }
.cm-s-monokai .CodeMirror-matchingbracket {
text-decoration: underline;
color: white !important;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,177 +0,0 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="https://esotericsoftware.com/files/spine-player/3.8/codemirror.js"></script>
<script src="jscolor.js"></script>
<script src="embedding-generator.js"></script>
<link rel="stylesheet" href="https://esotericsoftware.com/files/spine-player/3.8/codemirror.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<style>
* {
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
font-family: sans-serif;
}
#sp_generator_drop_zone {
width: 100%;
height: 100vh;
background: white;
text-align: center;
vertical-align: middle;
line-height: 100vh;
border: none;
cursor: pointer;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.sp_generator_hidden {
display: none !important;
}
#sp_generator_editor {
display: flex;
flex-direction: column;
width: 100%;
height: 100vh;
}
.sp_generator_tabs {
display: flex;
flex-direction: row;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
border-bottom: solid 1px #999999;
}
.sp_generator_tabs > span {
padding: 0.5em;
cursor: pointer;
}
.sp_generator_tabs > span:hover {
background:orangered;
}
.sp_generator_selected_tab {
border: solid 1px orangered;
}
.sp_generator_panel {
width: 100%;
height: 100%;
}
.sp_generator_panel TABLE TH {
text-align: right;
vertical-align: top;
}
.sp_generator_extra {
color: #ccc;
padding-left: 0.5em;
}
</style>
<body>
<div id="sp_generator_drop_zone" class="drop_zone">
<span>Choose .skel/.json, .atlas, and .png files, or drop them here.</span>
<input id="sp_generator_file_button" class="sp_generator_hidden" type="file" multiple accept=".json,.skel,.atlas,.png"/>
</div>
<div id="sp_generator_editor" class="sp_generator_hidden">
<div id="sp_generator_player">
</div>
<div id="sp_generator_config">
<div class="sp_generator_tabs">
<span class="sp_generator_selected_tab" data-tab="sp_generator_tab_general">General</span>
<span data-tab="sp_generator_tab_animations">Animations</span>
<span data-tab="sp_generator_tab_viewports">Viewports</span>
<span data-tab="sp_generator_tab_skins">Skins</span>
<span data-tab="sp_generator_tab_debug">Debug</span>
</div>
<div id="sp_generator_tab_general" class="sp_generator_panel">
<table>
<tr>
<th>Show controls</th>
<td><input id="sp_generator_show_controls" type="checkbox" checked="true"></td>
</tr>
<tr>
<th>Premultiplied alpha</th>
<td><input id="sp_generator_premultiplied_alpha" type="checkbox" checked="false"></td>
</tr>
<tr>
<th>Canvas alpha</th>
<td><input id="sp_generator_canvas_alpha" value="FF"></td>
</tr>
<tr>
<th>Background color</th>
<td><input id="sp_generator_background" class="jscolor {onFineChange:'changeBackgroundColor(this)'}'" value="000000"></td>
</tr>
<tr>
<th>Fullscreen background color</th>
<td><input id="sp_generator_background_fullscreen" class="jscolor {onFineChange:'changeFullscreenBackgroundColor(this)'}'" value="000000"></td>
</tr>
<tr style="vertical-align: top;">
<th>Background image</th>
<td>
<select id="sp_generator_background_image">
</select>
</td>
<td id="sp_generator_background_bounds" class="sp_generator_hidden">
<table>
<tr>
<th>X</th>
<td><input id="sp_generator_background_x"></td>
</tr>
<tr>
<th>Y</th>
<td><input id="sp_generator_background_y"></td>
</tr>
<tr>
<th>Width</th>
<td><input id="sp_generator_background_width"></td>
</tr>
<tr>
<th>Height</th>
<td><input id="sp_generator_background_height"></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div id="sp_generator_tab_animations" class="sp_generator_panel sp_generator_hidden">
Animations
</div>
<div id="sp_generator_tab_viewports" class="sp_generator_panel sp_generator_hidden">
Viewports
</div>
<div id="sp_generator_tab_skins" class="sp_generator_panel sp_generator_hidden">
Skins
</div>
<div id="sp_generator_tab_debug" class="sp_generator_panel sp_generator_hidden">
Debug
</div>
</div>
</div>
</body>
</html>

View File

@@ -1,436 +0,0 @@
window.addEventListener("load", function(event) {
setupDropZone();
});
if (!String.prototype.endsWith) {
String.prototype.endsWith = function(search, this_len) {
if (this_len === undefined || this_len > this.length) {
this_len = this.length;
}
return this.substring(this_len - search.length, this_len) === search;
};
}
var appState = {
dataUrls: null,
jsonFile: null,
skelFile: null,
atlasFile: null,
minorVersion: null,
majorVersion: null,
player: null
}
function loadFiles(files) {
var skels = 0;
var skelFile = null;
var jsons = 0;
var jsonFile = null;
var atlases = 0;
var atlasFile = null;
var pngs = 0;
for (var i = 0; i < files.length; i++) {
var file = files[i].name.toLowerCase();
if (file.endsWith(".skel")) {
skels++;
skelFile = file;
}
if (file.endsWith(".json")) {
jsons++;
jsonFile = file;
}
if (file.endsWith(".atlas")) {
atlases++;
atlasFile = file;
}
if (file.endsWith(".png")) pngs++;
}
if ((skels == 0 && jsons == 0) || (skels != 0 && jsons != 0) || skels > 1 || jsons > 1) {
showError("Please specify a single .skel or .json file.");
return;
}
if (atlases != 1) {
showError("Please specify a single .atlas file.");
return;
}
var filesToLoad = files.length;
var dataUrls = {};
for (var i = 0; i < files.length; i++) {
var file = files[i];
var reader = new FileReader();
reader.onload = function(file) {
return function(dataUrl) {
console.log("Loaded " + file.name);
dataUrls[file.name] = dataUrl.target.result;
filesToLoad--;
if (filesToLoad == 0) {
setupPlayer(dataUrls, jsonFile, skelFile, atlasFile);
}
};
}(file);
reader.onerror = function () {
showError("Sorry, couldn't load all files.");
}
reader.readAsDataURL(file);
}
}
function setupPlayer(dataUrls, jsonFile, skelFile, atlasFile) {
var version = getSkeletonVersion(dataUrls, jsonFile, skelFile);
var major = parseInt(version.split("\.")[0]);
var minor = parseInt(version.split("\.")[1]);
appState.dataUrls = dataUrls;
appState.jsonFile = jsonFile;
appState.skelFile = skelFile;
appState.atlasFile = atlasFile;
appState.majorVersion = major;
appState.minorVersion = minor;
if (major == 3 && minor < 8) {
showError("Couldn't load script for Spine version " + version + ". Only skeletons with version >= 3.8 are supported.");
return;
}
var cssUrl = "https://esotericsoftware.com/files/spine-player/" + major + "." + minor + "/spine-player.css";
spine = null;
loadCSS(cssUrl, function () {
var playerUrl = "https://esotericsoftware.com/files/spine-player/" + major + "." + minor + "/spine-player.js";
loadJavaScript(playerUrl, function() {
document.getElementById("sp_generator_editor").classList.remove("sp_generator_hidden");
document.getElementById("sp_generator_drop_zone").classList.add("sp_generator_hidden");
var player = document.getElementById("sp_generator_player");
player.innerHTML = "";
var config = {
jsonUrl: jsonFile,
skelUrl: skelFile,
atlasUrl: atlasFile,
rawDataURIs: dataUrls,
success: setupConfigUI,
alpha: true, // needed so we can emulate shizzle
viewport: { // needed so we can see viewport bounds
debugRender: true
}
};
appState.player = new spine.SpinePlayer(player, config);
}, function() {
showError("Couldn't load script for Spine version " + version + ". Only skeletons with version 3.8+ are supported.");
});
}, function () {
showError("Couldn't load CSS for Spine version " + version + ". Only skeletons with version 3.8+ are supported.");
});
}
function setupConfigUI() {
// Setup tabs
var tabs = document.getElementsByClassName("sp_generator_tabs")[0];
var children = tabs.getElementsByTagName("span");
for (var i = 0; i < children.length; i++) {
(function (tab) {
tab.onclick = function () {
var panelId = tab.getAttribute("data-tab");
var panels = document.getElementById("sp_generator_config").getElementsByClassName("sp_generator_panel");
for (var i = 0; i < panels.length; i++) {
var panel = panels[i];
if (panelId == panel.getAttribute("id")) {
tab.classList.add("sp_generator_selected_tab");
panel.classList.remove("sp_generator_hidden");
} else {
tab.classList.remove("sp_generator_selected_tab");
panel.classList.add("sp_generator_hidden");
}
}
}
})(children[i]);
}
// Fill general tab
var showControls = document.getElementById("sp_generator_show_controls");
showControls.onchange = function () {
appState.player.config.showControls = showControls.checked;
};
var canvasAlpha = document.getElementById("sp_generator_canvas_alpha");
canvasAlpha.onchange = function () {
var re = /[0-9A-Fa-f]{2}/g;
if (canvasAlpha.value.length > 2 || !re.test(canvasAlpha.value))
canvasAlpha.value = "FF";
else
canvasAlpha.value = canvasAlpha.value.toUpperCase();
var alpha = Number.parseInt(canvasAlpha.value, 16);
appState.player.config.alpha = alpha != 0xff;
appState.player.config.backgroundColor = document.getElementById("sp_generator_background").value + canvasAlpha.value;
}
var premultipliedAlpha = document.getElementById("sp_generator_premultiplied_alpha");
var premultipliedAlpha = document.getElementById("sp_generator_premultiplied_alpha");
premultipliedAlpha.onchange = function () {
appState.player.config.premultipliedAlpha = premultipliedAlpha.checked;
}
var backgroundImage = document.getElementById("sp_generator_background_image");
backgroundImage.innerHTML = "";
var noneImage = document.createElement("option");
noneImage.value = "none";
noneImage.innerText = "None";
noneImage.selected = true;
backgroundImage.append(noneImage);
for(var data in appState.dataUrls) {
if (data.toLowerCase().endsWith(".png")) {
var image = document.createElement("option");
image.value = data;
image.innerText = data;
backgroundImage.append(image);
}
}
backgroundImage.onchange = function() {
var imageUrl = backgroundImage.value;
if (imageUrl != "none" && !appState.player.assetManager.get(imageUrl)) {
appState.player.assetManager.loadTexture(imageUrl);
}
var boundsTable = document.getElementById("sp_generator_background_bounds");
if (imageUrl == "none")
boundsTable.classList.add("sp_generator_hidden");
else
boundsTable.classList.remove("sp_generator_hidden");
if (appState.player.config.backgroundImage) {
appState.player.config.backgroundImage.url = imageUrl != "none" ? imageUrl: null;
} else {
appState.player.config.backgroundImage = {
url: imageUrl != "none" ? imageUrl : null
}
}
}
var backgroundX = document.getElementById("sp_generator_background_x");
backgroundX.onkeyup = backgroundX.onchange = function () {
var value = Number.parseFloat(backgroundX.value);
if (Number.isNaN(value)) return;
appState.player.config.backgroundImage.x = value;
};
var backgroundY = document.getElementById("sp_generator_background_y");
backgroundY.onkeyup = backgroundY.onchange = function () {
var value = Number.parseFloat(backgroundY.value);
if (Number.isNaN(value)) return;
appState.player.config.backgroundImage.y = value;
};
var backgroundWidth = document.getElementById("sp_generator_background_width");
backgroundWidth.onkeyup = backgroundWidth.onchange = function () {
var value = Number.parseFloat(backgroundWidth.value);
if (Number.isNaN(value)) return;
appState.player.config.backgroundImage.width = value;
};
var backgroundHeight = document.getElementById("sp_generator_background_height");
backgroundHeight.onkeyup = backgroundHeight.onchange = function () {
var value = Number.parseFloat(backgroundHeight.value);
if (Number.isNaN(value)) return;
appState.player.config.backgroundImage.height = value;
};
// Fill animations tab
// Fill viewports tab
// Fill skins tab
// Fill debug tab
}
function changeBackgroundColor(background) {
appState.player.config.backgroundColor = background.valueElement.value + document.getElementById("sp_generator_canvas_alpha").value;
}
function changeFullscreenBackgroundColor(background) {
appState.player.config.fullScreenBackgroundColor = background.valueElement.value;
}
function getSkeletonVersion(dataUrls, jsonFile, skelFile) {
if (jsonFile) {
var json = JSON.parse(atob(dataUrls[jsonFile].split(',')[1]));
return json.skeleton.spine;
} else {
var bytes = atob(dataUrls[skelFile].split(',')[1]);
var array = new Uint8Array(new ArrayBuffer(bytes.length));
for (var i = 0; i < bytes.length; i++) {
array[i] = bytes.charCodeAt(i);
}
var input = new BinaryInput(array);
input.readString();
var version = input.readString();
return version;x
}
}
function loadJavaScript(url, success, error) {
var script = document.createElement('script');
script.setAttribute('src', url);
script.setAttribute('type', 'text/javascript');
script.onload = success;
script.onerror = error;
document.getElementsByTagName("head")[0].appendChild(script);
};
function loadCSS(url, success, error) {
var script = document.createElement('link');
script.setAttribute('href', url);
script.setAttribute('rel', 'stylesheet');
script.onload = success;
script.onerror = error;
document.getElementsByTagName("head")[0].appendChild(script);
};
function showError(error) {
alert(error);
}
function setupDropZone() {
var fileButton = document.getElementById("sp_generator_file_button");
var dropZone = document.getElementById("sp_generator_drop_zone");
dropZone.onclick = function() {
fileButton.click();
};
dropZone.addEventListener("dragenter", function (event) {
event.stopPropagation();
event.preventDefault();
}, false);
dropZone.addEventListener("dragover", function (event) {
event.stopPropagation();
event.preventDefault();
}, false);
dropZone.addEventListener("drop", function (event) {
event.stopPropagation();
event.preventDefault();
loadFiles(event.dataTransfer.files);
}, false);
fileButton.onchange = function () {
loadFiles(fileButton.files);
fileButton.value = "";
};
}
function generateScript(jsonFile, skelFile, atlasFile, dataUrls) {
var shortVersion = major + "." + minor;
var scriptCode =
'<script src="https://esotericsoftware.com/files/spine-player/' + shortVersion + '/spine-player.js"><' + '/script>\n' +
'<link rel="stylesheet" href="https://esotericsoftware.com/files/spine-player/' + shortVersion + '/spine-player.css">\n\n' +
'<div id="player-container" style="width: 100%; height: 100vh;"></div>\n\n' +
'<script>\n' +
'new spine.SpinePlayer("player-container", {\n';
if (jsonFile) scriptCode +=
' jsonUrl: "' + jsonFile + '",\n';
else scriptCode +=
' skelUrl: "' + skelFile + '",\n';
scriptCode +=
' atlasUrl: "' + atlasFile + '",\n' +
' rawDataURIs: {\n'
for (var file in dataUrls) {
scriptCode +=
' "' + file + '": "' + dataUrls[file] + '",\n';
}
scriptCode +=
' }\n' +
'});\n' +
'<' + '/script>';
}
var BinaryInput = (function () {
function BinaryInput(data, strings, index, buffer) {
if (strings === void 0) { strings = new Array(); }
if (index === void 0) { index = 0; }
if (buffer === void 0) { buffer = new DataView(data.buffer); }
this.strings = strings;
this.index = index;
this.buffer = buffer;
}
BinaryInput.prototype.readByte = function () {
return this.buffer.getInt8(this.index++);
};
BinaryInput.prototype.readShort = function () {
var value = this.buffer.getInt16(this.index);
this.index += 2;
return value;
};
BinaryInput.prototype.readInt32 = function () {
var value = this.buffer.getInt32(this.index);
this.index += 4;
return value;
};
BinaryInput.prototype.readInt = function (optimizePositive) {
var b = this.readByte();
var result = b & 0x7F;
if ((b & 0x80) != 0) {
b = this.readByte();
result |= (b & 0x7F) << 7;
if ((b & 0x80) != 0) {
b = this.readByte();
result |= (b & 0x7F) << 14;
if ((b & 0x80) != 0) {
b = this.readByte();
result |= (b & 0x7F) << 21;
if ((b & 0x80) != 0) {
b = this.readByte();
result |= (b & 0x7F) << 28;
}
}
}
}
return optimizePositive ? result : ((result >>> 1) ^ -(result & 1));
};
BinaryInput.prototype.readStringRef = function () {
var index = this.readInt(true);
return index == 0 ? null : this.strings[index - 1];
};
BinaryInput.prototype.readString = function () {
var byteCount = this.readInt(true);
switch (byteCount) {
case 0:
return null;
case 1:
return "";
}
byteCount--;
var chars = "";
var charCount = 0;
for (var i = 0; i < byteCount;) {
var b = this.readByte();
switch (b >> 4) {
case 12:
case 13:
chars += String.fromCharCode(((b & 0x1F) << 6 | this.readByte() & 0x3F));
i += 2;
break;
case 14:
chars += String.fromCharCode(((b & 0x0F) << 12 | (this.readByte() & 0x3F) << 6 | this.readByte() & 0x3F));
i += 3;
break;
default:
chars += String.fromCharCode(b);
i++;
}
}
return chars;
};
BinaryInput.prototype.readFloat = function () {
var value = this.buffer.getFloat32(this.index);
this.index += 4;
return value;
};
BinaryInput.prototype.readBoolean = function () {
return this.readByte() != 0;
};
return BinaryInput;
}());

View File

@@ -1,152 +0,0 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="jscolor.js"></script>
<script src="ui.js"></script>
<script src="loader.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<style>
* {
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
font-family: sans-serif;
}
#dropzone {
width: 100%;
height: 100vh;
background: #cccccc;
text-align: center;
line-height: 100vh;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
cursor: pointer;
}
#editor {
display: flex;
flex-direction: row-reverse;
width: 100%;
height: 100vh;
background: #aaaaaa;
}
#player {
width: 100%;
height: 100%;
}
#config {
width: 100%;
height: 100%;
padding: 1em;
background: #f0f0f0;
}
</style>
<body>
<div id="dropzone">
Click to choose .skel/.json, .atlas, and .png files, or drop them here.
</div>
<div id="editor" style="display: none">
</div>
<script>
var UI;
var Loader;
var dropZone = document.getElementById("dropzone");
var editor = document.getElementById("editor")
function showError(errorMessage) {
alert(errorMessage);
}
window.addEventListener("load", function(event) {
UI = spineGenerator.UI;
Loader = spineGenerator.Loader;
var dropZone = document.getElementById("dropzone");
new UI.DropZone(dropZone, true, ".json,.skel,.atlas,.png", function (files) {
spineGenerator.Loader.loadSkeletonFiles(files, function(data) {
console.log(`Loaded files ${data.jsonFile} ${data.skelFile} ${data.atlasFile}`);
console.log(`${data.version} ${data.majorVersion} ${data.minorVersion} ${data.patchVersion}`);
spine = null;
var cssUrl = `https://esotericsoftware.com/files/spine-player/${data.majorVersion}.${data.minorVersion}/spine-player.css`;
var playerUrl = `https://esotericsoftware.com/files/spine-player/${data.majorVersion}.${data.minorVersion}/spine-player.js`;
Loader.loadStyle(cssUrl, function () {
Loader.loadJavaScript(playerUrl, function () {
UI.hide(dropZone)
setupEditor(editor, data);
});
}, showError);
}, showError);
}, showError);
});
function setupEditor(editor, data) {
setupPlayer(editor, data, function(player) {
setupConfig(editor, player, data);
UI.show(editor, "flex");
}, showError)
}
function setupPlayer(editor, data, success, error) {
var playerElement = UI.createElement(editor, `<div id="player"></div>`);
var config = {
jsonUrl: data.jsonFile,
skelUrl: data.skelFile,
atlasUrl: data.atlasFile,
rawDataURIs: data.dataUrls,
success: success,
error: error,
alpha: true, // needed so we can emulate shizzle
viewport: { // needed so we can see viewport bounds
debugRender: true
}
};
return new spine.SpinePlayer(playerElement, config);
}
function setupConfig(editor, player, data) {
var cfg = UI.createElement(editor, `<div id="config"></div>`);
var topBar = UI.createElement(cfg, /*html*/`
<div style="display: flex; flex-direction: row;">
<button type="button">New</button>
<button type="button">Download HTML</button>
</div>
`);
var newButton = topBar.children[0];
newButton.onclick = function() {
player.stopRendering();
UI.show(dropZone);
UI.clear(editor);
UI.hide(editor);
}
var downloadButton = topBar.children[1];
UI.createElement(cfg, `<h3>General</h3>`);
}
</script>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -1,186 +0,0 @@
var spineGenerator;
(function (spineGenerator) {
var Loader = (function () {
function Loader() {
}
Loader.loadSkeletonFiles = function(files, success, error) {
var skels = 0;
var skelFile = null;
var jsons = 0;
var jsonFile = null;
var atlases = 0;
var atlasFile = null;
var pngs = 0;
for (var i = 0; i < files.length; i++) {
var file = files[i].name.toLowerCase();
if (file.endsWith(".skel")) {
skels++;
skelFile = file;
}
if (file.endsWith(".json")) {
jsons++;
jsonFile = file;
}
if (file.endsWith(".atlas")) {
atlases++;
atlasFile = file;
}
if (file.endsWith(".png")) pngs++;
}
if ((skels == 0 && jsons == 0) || (skels != 0 && jsons != 0) || skels > 1 || jsons > 1) {
error("Please specify a single .skel or .json file.");
return;
}
if (atlases != 1) {
error("Please specify a single .atlas file.");
return;
}
var filesToLoad = files.length;
var dataUrls = {};
for (var i = 0; i < files.length; i++) {
var file = files[i];
var reader = new FileReader();
reader.onload = function(file) {
return function(dataUrl) {
console.log("Loaded " + file.name);
dataUrls[file.name] = dataUrl.target.result;
filesToLoad--;
if (filesToLoad == 0) {
var data = {
dataUrls: dataUrls,
jsonFile: jsonFile,
skelFile: skelFile,
atlasFile: atlasFile
};
var version = data.version = Loader.getSkeletonVersion(data);
data.majorVersion = parseInt(version.split("\.")[0]);
data.minorVersion = parseInt(version.split("\.")[1]);
data.patchVersion = parseInt(version.split("\.")[2]);
success(data);
}
};
}(file);
reader.onerror = function () {
error("Sorry, couldn't load all files.");
}
reader.readAsDataURL(file);
}
}
Loader.getSkeletonVersion = function (data) {
var jsonFile = data.jsonFile;
var skelFile = data.skelFile;
var dataUrls = data.dataUrls;
if (jsonFile) {
var json = JSON.parse(atob(dataUrls[jsonFile].split(',')[1]));
return json.skeleton.spine;
} else {
var bytes = atob(dataUrls[skelFile].split(',')[1]);
var array = new Uint8Array(new ArrayBuffer(bytes.length));
for (var i = 0; i < bytes.length; i++) {
array[i] = bytes.charCodeAt(i);
}
var input = new BinaryInput(array);
input.readString();
var version = input.readString();
return version;
}
}
Loader.loadJavaScript = function (url, success, error) {
var script = document.createElement('script');
script.setAttribute('src', url);
script.setAttribute('type', 'text/javascript');
script.onload = success;
script.onerror = error;
document.getElementsByTagName("head")[0].appendChild(script);
};
Loader.loadStyle = function(url, success, error) {
var style = document.createElement('link');
style.setAttribute('href', url);
style.setAttribute('rel', 'stylesheet');
style.onload = success;
style.onerror = error;
document.getElementsByTagName("head")[0].appendChild(style);
};
var BinaryInput = (function () {
function BinaryInput(data, strings, index, buffer) {
if (strings === void 0) { strings = new Array(); }
if (index === void 0) { index = 0; }
if (buffer === void 0) { buffer = new DataView(data.buffer); }
this.index = index;
this.buffer = buffer;
}
BinaryInput.prototype.readByte = function () {
return this.buffer.getInt8(this.index++);
};
BinaryInput.prototype.readInt = function (optimizePositive) {
var b = this.readByte();
var result = b & 0x7F;
if ((b & 0x80) != 0) {
b = this.readByte();
result |= (b & 0x7F) << 7;
if ((b & 0x80) != 0) {
b = this.readByte();
result |= (b & 0x7F) << 14;
if ((b & 0x80) != 0) {
b = this.readByte();
result |= (b & 0x7F) << 21;
if ((b & 0x80) != 0) {
b = this.readByte();
result |= (b & 0x7F) << 28;
}
}
}
}
return optimizePositive ? result : ((result >>> 1) ^ -(result & 1));
};
BinaryInput.prototype.readString = function () {
var byteCount = this.readInt(true);
switch (byteCount) {
case 0:
return null;
case 1:
return "";
}
byteCount--;
var chars = "";
var charCount = 0;
for (var i = 0; i < byteCount;) {
var b = this.readByte();
switch (b >> 4) {
case 12:
case 13:
chars += String.fromCharCode(((b & 0x1F) << 6 | this.readByte() & 0x3F));
i += 2;
break;
case 14:
chars += String.fromCharCode(((b & 0x0F) << 12 | (this.readByte() & 0x3F) << 6 | this.readByte() & 0x3F));
i += 3;
break;
default:
chars += String.fromCharCode(b);
i++;
}
}
return chars;
};
return BinaryInput;
}());
return Loader;
}());
spineGenerator.Loader = Loader;
}(spineGenerator || (spineGenerator = {})));

View File

@@ -1,66 +0,0 @@
var spineGenerator;
(function (spineGenerator) {
var UI = (function () {
function UI(dropZone, multiple, acceptedExtensions, callback) {
}
UI.createElement = function (parent, html) {
parent.insertAdjacentHTML("beforeend", html);
return parent.lastElementChild;
}
UI.clear = function(element) {
element.innerHTML = "";
}
UI.hide = function(element) {
element.__oldDisplay = element.style.display;
element.style.display = "none";
}
UI.show = function(element, display) {
if (display) element.style.display = display;
else if (element.__oldDisplay) element.style.display = element.__oldDisplay;
else element.style.display = "block";
}
return UI;
}());
spineGenerator.UI = UI;
}(spineGenerator || (spineGenerator = {})));
(function (spineGenerator) {
var UI = spineGenerator.UI;
var DropZone = (function () {
function DropZone(dropZone, multiple, acceptedExtensions, callback) {
var fileButton = this.fileButton = UI.createElement(dropZone,
`<input style="display:none;" type="file" ${multiple?"multiple":""} accept="${acceptedExtensions}"/>`);
dropZone.onclick = function() {
fileButton.click();
};
dropZone.addEventListener("dragenter", function (event) {
event.stopPropagation();
event.preventDefault();
}, false);
dropZone.addEventListener("dragover", function (event) {
event.stopPropagation();
event.preventDefault();
}, false);
dropZone.addEventListener("drop", function (event) {
event.stopPropagation();
event.preventDefault();
loadFiles(event.dataTransfer.files);
}, false);
fileButton.onchange = function () {
callback(fileButton.files);
fileButton.value = "";
};
}
return DropZone;
}());
spineGenerator.UI.DropZone = DropZone;
}(spineGenerator || (spineGenerator = {})));

View File

@@ -1,71 +0,0 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="../../build/spine-player.js"></script>
<link rel="stylesheet" href="../css/spine-player.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<style>
body {
background: gray;
margin: 0px;
}
</style>
<body>
<div id="container" style="width: 640px; height: 380px;"></div>
<div id="container-raptor" style="width: 640px; height: 380px;"></div>
<div>
<button id="walk">Walk</button>
<button id="jump">Jump</button>
<button id="roar">Roar</button>
</div>
</body>
<script>
// Creates a new spine player. The debugRender option enables
// rendering of viewports and padding for debugging purposes.
new spine.SpinePlayer("container", {
skelUrl: "assets/spineboy-pro.skel",
atlasUrl: "assets/spineboy-pma.atlas",
animation: "run",
premultipliedAlpha: true,
backgroundColor: "#cccccc",
viewport: {
debugRender: true,
},
showControls: true,
});
// Creates a new spine player with a transparent background,
// so content from the website shines through. Hides the controls.
// Instead, the user can control the animation via buttons.
var jsControlledPlayer = new spine.SpinePlayer("container-raptor", {
jsonUrl: "assets/raptor-pro.json",
atlasUrl: "assets/raptor-pma.atlas",
animation: "walk",
showControls: false,
premultipliedAlpha: true,
backgroundColor: "#00000000",
alpha: true,
defaultMix: 1,
success: (player) => {
// Register button click event handlers once the
// skeleton has been loaded successfully
document.getElementById("walk").addEventListener("click", event => {
jsControlledPlayer.setAnimation("walk", false); // set the walk animation to play once
});
document.getElementById("jump").addEventListener("click", event => {
jsControlledPlayer.setAnimation("jump", false); // set the jump animation to play once
});
document.getElementById("roar").addEventListener("click", event => {
jsControlledPlayer.setAnimation("roar", true); // set the jump animation to loop
});
}
});
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@@ -1,119 +0,0 @@
/******************************************************************************
* Spine Runtimes License Agreement
* Last updated January 1, 2020. Replaces all prior versions.
*
* Copyright (c) 2013-2020, Esoteric Software LLC
*
* Integration of the Spine Runtimes into software or otherwise creating
* derivative works of the Spine Runtimes is permitted under the terms and
* conditions of Section 2 of the Spine Editor License Agreement:
* http://esotericsoftware.com/spine-editor-license
*
* Otherwise, it is permitted to integrate the Spine Runtimes into software
* or otherwise create derivative works of the Spine Runtimes (collectively,
* "Products"), provided that each user of the Products must obtain their own
* Spine Editor license and redistribution of the Products in any form must
* include this license and copyright notice.
*
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
declare function CodeMirror(el: Element, config: any): void;
module spine {
export class SpinePlayerEditor {
private static DEFAULT_CODE =
`
<script src="https://esotericsoftware.com/files/spine-player/3.7/spine-player.js"></script>
<link rel="stylesheet" href="https://esotericsoftware.com/files/spine-player/3.7/spine-player.css">
<div id="player-container" style="width: 100%; height: 100vh;"></div>
<script>
new spine.SpinePlayer("player-container", {
jsonUrl: "https://esotericsoftware.com/files/examples/spineboy/export/spineboy-pro.json",
atlasUrl: "https://esotericsoftware.com/files/examples/spineboy/export/spineboy-pma.atlas"
});
</script>
`.trim();
private prefix: string =
`<html>
<head>
<style>
body {
margin: 0px;
}
</style>
</head>
<body>`.trim()
private postfix: string = `</body>`;
private code: any;
private player: HTMLIFrameElement;
constructor(parent: HTMLElement) {
this.render(parent);
}
private render (parent: HTMLElement) {
let dom = /*html*/`
<div class="spine-player-editor-container">
<div class="spine-player-editor-code"></div>
<iframe class="spine-player-editor-player"></iframe>
</div>
`;
parent.innerHTML = dom;
let codeElement = parent.getElementsByClassName("spine-player-editor-code")[0];
this.player = parent.getElementsByClassName("spine-player-editor-player")[0] as HTMLIFrameElement;
requestAnimationFrame(() => {
this.code = CodeMirror(codeElement, {
lineNumbers: true,
tabSize: 3,
indentUnit: 3,
indentWithTabs: true,
scrollBarStyle: "native",
mode: "htmlmixed",
theme: "monokai"
});
this.code.on("change", () => {
this.startPlayer();
});
this.setCode(SpinePlayerEditor.DEFAULT_CODE);
})
}
setPreAndPostfix(prefix: string, postfix: string) {
this.prefix = prefix;
this.postfix = postfix;
this.startPlayer()
}
setCode(code: string) {
this.code.setValue(code);
this.startPlayer();
}
private timerId = 0;
startPlayer() {
clearTimeout(this.timerId);
this.timerId = setTimeout( () => {
let code = this.code.getDoc().getValue();
code = this.prefix + code + this.postfix;
code = window.btoa(code);
this.player.src = "";
this.player.src = "data:text/html;base64," + code;
}, 500);
}
}
}

File diff suppressed because one or more lines are too long

View File

@@ -1,272 +0,0 @@
raptor.png
size: 1024,512
format: RGBA8888
filter: Linear,Linear
repeat: none
back-arm
rotate: true
xy: 829, 88
size: 46, 25
orig: 46, 25
offset: 0, 0
index: -1
back-bracer
rotate: true
xy: 195, 238
size: 39, 28
orig: 39, 28
offset: 0, 0
index: -1
back-hand
rotate: true
xy: 724, 140
size: 36, 34
orig: 36, 34
offset: 0, 0
index: -1
back-knee
rotate: true
xy: 760, 131
size: 49, 67
orig: 49, 67
offset: 0, 0
index: -1
back-thigh
rotate: true
xy: 225, 238
size: 39, 24
orig: 39, 24
offset: 0, 0
index: -1
eyes-open
rotate: false
xy: 975, 204
size: 47, 45
orig: 47, 45
offset: 0, 0
index: -1
front-arm
rotate: false
xy: 969, 112
size: 48, 26
orig: 48, 26
offset: 0, 0
index: -1
front-bracer
rotate: true
xy: 724, 97
size: 41, 29
orig: 41, 29
offset: 0, 0
index: -1
front-hand
rotate: false
xy: 251, 239
size: 41, 38
orig: 41, 38
offset: 0, 0
index: -1
front-open-hand
rotate: true
xy: 856, 76
size: 43, 44
orig: 43, 44
offset: 0, 0
index: -1
front-thigh
rotate: true
xy: 729, 178
size: 57, 29
orig: 57, 29
offset: 0, 0
index: -1
gun
rotate: false
xy: 894, 251
size: 107, 103
orig: 107, 103
offset: 0, 0
index: -1
gun-nohand
rotate: false
xy: 764, 241
size: 105, 102
orig: 105, 102
offset: 0, 0
index: -1
head
rotate: false
xy: 756, 345
size: 136, 149
orig: 136, 149
offset: 0, 0
index: -1
lower-leg
rotate: true
xy: 475, 237
size: 73, 98
orig: 73, 98
offset: 0, 0
index: -1
mouth-grind
rotate: false
xy: 975, 172
size: 47, 30
orig: 47, 30
offset: 0, 0
index: -1
mouth-smile
rotate: false
xy: 975, 140
size: 47, 30
orig: 47, 30
offset: 0, 0
index: -1
neck
rotate: false
xy: 366, 282
size: 18, 21
orig: 18, 21
offset: 0, 0
index: -1
raptor-back-arm
rotate: true
xy: 636, 97
size: 82, 86
orig: 82, 86
offset: 0, 0
index: -1
raptor-body
rotate: false
xy: 2, 2
size: 632, 233
orig: 632, 233
offset: 0, 0
index: -1
raptor-front-arm
rotate: true
xy: 871, 168
size: 81, 102
orig: 81, 102
offset: 0, 0
index: -1
raptor-front-leg
rotate: false
xy: 2, 237
size: 191, 257
orig: 191, 257
offset: 0, 0
index: -1
raptor-hindleg-back
rotate: false
xy: 195, 279
size: 169, 215
orig: 169, 215
offset: 0, 0
index: -1
raptor-horn
rotate: true
xy: 431, 312
size: 182, 80
orig: 182, 80
offset: 0, 0
index: -1
raptor-horn-back
rotate: true
xy: 513, 318
size: 176, 77
orig: 176, 77
offset: 0, 0
index: -1
raptor-jaw
rotate: false
xy: 894, 356
size: 126, 138
orig: 126, 138
offset: 0, 0
index: -1
raptor-jaw-tooth
rotate: true
xy: 294, 240
size: 37, 48
orig: 37, 48
offset: 0, 0
index: -1
raptor-mouth-inside
rotate: true
xy: 344, 241
size: 36, 41
orig: 36, 41
offset: 0, 0
index: -1
raptor-saddle-strap-back
rotate: false
xy: 575, 242
size: 54, 74
orig: 54, 74
offset: 0, 0
index: -1
raptor-saddle-strap-front
rotate: true
xy: 764, 182
size: 57, 95
orig: 57, 95
offset: 0, 0
index: -1
raptor-saddle-w-shadow
rotate: false
xy: 592, 323
size: 162, 171
orig: 162, 171
offset: 0, 0
index: -1
raptor-tail-shadow
rotate: true
xy: 366, 305
size: 189, 63
orig: 189, 63
offset: 0, 0
index: -1
raptor-tongue
rotate: false
xy: 387, 239
size: 86, 64
orig: 86, 64
offset: 0, 0
index: -1
stirrup-back
rotate: true
xy: 829, 136
size: 44, 35
orig: 44, 35
offset: 0, 0
index: -1
stirrup-front
rotate: true
xy: 866, 121
size: 45, 50
orig: 45, 50
offset: 0, 0
index: -1
stirrup-strap
rotate: false
xy: 918, 120
size: 49, 46
orig: 49, 46
offset: 0, 0
index: -1
torso
rotate: true
xy: 636, 181
size: 54, 91
orig: 54, 91
offset: 0, 0
index: -1
visor
rotate: false
xy: 631, 237
size: 131, 84
orig: 131, 84
offset: 0, 0
index: -1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 468 KiB

View File

@@ -1,122 +0,0 @@
<html>
<head>
<meta charset="UTF-8">
<title>spine-threejs</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/110/three.min.js"></script>
<script src="../../build/spine-threejs.js"></script>
</head>
<style>
* { margin: 0; padding: 0; }
body, html { height: 100% }
canvas { position: absolute; width: 100% ;height: 100%; }
</style>
<body>
<script>
var scene, camera, renderer;
var geometry, material, mesh, skeletonMesh;
var assetManager;
var canvas;
var lastFrameTime = Date.now() / 1000;
var baseUrl = "assets/";
var skeletonFile = "raptor-pro.json";
var atlasFile = skeletonFile.replace("-pro", "").replace("-ess", "").replace(".json", ".atlas");
var animation = "walk";
function init () {
// create the THREE.JS camera, scene and renderer (WebGL)
var width = window.innerWidth, height = window.innerHeight;
camera = new THREE.PerspectiveCamera(75, width / height, 1, 3000);
camera.position.y = 100;
camera.position.z = 400;
scene = new THREE.Scene();
renderer = new THREE.WebGLRenderer();
renderer.setSize(width, height);
document.body.appendChild(renderer.domElement);
canvas = renderer.domElement;
// load the assets required to display the Raptor model
assetManager = new spine.threejs.AssetManager(baseUrl);
assetManager.loadText(skeletonFile);
assetManager.loadTextureAtlas(atlasFile);
requestAnimationFrame(load);
}
function load (name, scale) {
if (assetManager.isLoadingComplete()) {
// Add a box to the scene to which we attach the skeleton mesh
geometry = new THREE.BoxGeometry(200, 200, 200);
material = new THREE.MeshBasicMaterial({ color: 0xff0000, wireframe: true });
mesh = new THREE.Mesh(geometry, material);
scene.add(mesh);
// Load the texture atlas using name.atlas and name.png from the AssetManager.
// The function passed to TextureAtlas is used to resolve relative paths.
atlas = assetManager.get(atlasFile);
// Create a AtlasAttachmentLoader that resolves region, mesh, boundingbox and path attachments
atlasLoader = new spine.AtlasAttachmentLoader(atlas);
// Create a SkeletonJson instance for parsing the .json file.
var skeletonJson = new spine.SkeletonJson(atlasLoader);
// Set the scale to apply during parsing, parse the file, and create a new skeleton.
skeletonJson.scale = 0.4;
var skeletonData = skeletonJson.readSkeletonData(assetManager.get(skeletonFile));
// Create a SkeletonMesh from the data and attach it to the scene
skeletonMesh = new spine.threejs.SkeletonMesh(skeletonData, function(parameters) {
parameters.depthTest = false;
});
skeletonMesh.state.setAnimation(0, animation, true);
mesh.add(skeletonMesh);
requestAnimationFrame(render);
} else requestAnimationFrame(load);
}
var lastTime = Date.now();
function render() {
// calculate delta time for animation purposes
var now = Date.now() / 1000;
var delta = now - lastFrameTime;
lastFrameTime = now;
// resize canvas to use full page, adjust camera/renderer
resize();
// rotate the cube
mesh.rotation.x = Math.sin(now) * Math.PI * 0.2;
mesh.rotation.y = Math.cos(now) * Math.PI * 0.4;
// update the animation
skeletonMesh.update(delta);
// render the scene
renderer.render(scene, camera);
requestAnimationFrame(render);
}
function resize () {
var w = window.innerWidth;
var h = window.innerHeight;
if (canvas.width != w || canvas.height != h) {
canvas.width = w;
canvas.height = h;
}
camera.aspect = w / h;
camera.updateProjectionMatrix();
renderer.setSize(w, h);
}
(function() {
init();
}());
</script>
</body>
</html>

View File

@@ -1,38 +0,0 @@
/******************************************************************************
* Spine Runtimes License Agreement
* Last updated January 1, 2020. Replaces all prior versions.
*
* Copyright (c) 2013-2020, Esoteric Software LLC
*
* Integration of the Spine Runtimes into software or otherwise creating
* derivative works of the Spine Runtimes is permitted under the terms and
* conditions of Section 2 of the Spine Editor License Agreement:
* http://esotericsoftware.com/spine-editor-license
*
* Otherwise, it is permitted to integrate the Spine Runtimes into software
* or otherwise create derivative works of the Spine Runtimes (collectively,
* "Products"), provided that each user of the Products must obtain their own
* Spine Editor license and redistribution of the Products in any form must
* include this license and copyright notice.
*
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
module spine.threejs {
export class AssetManager extends spine.AssetManager {
constructor (pathPrefix: string = "") {
super((image: HTMLImageElement) => {
return new ThreeJsTexture(image);
}, pathPrefix);
}
}
}

View File

@@ -1,125 +0,0 @@
/******************************************************************************
* Spine Runtimes License Agreement
* Last updated January 1, 2020. Replaces all prior versions.
*
* Copyright (c) 2013-2020, Esoteric Software LLC
*
* Integration of the Spine Runtimes into software or otherwise creating
* derivative works of the Spine Runtimes is permitted under the terms and
* conditions of Section 2 of the Spine Editor License Agreement:
* http://esotericsoftware.com/spine-editor-license
*
* Otherwise, it is permitted to integrate the Spine Runtimes into software
* or otherwise create derivative works of the Spine Runtimes (collectively,
* "Products"), provided that each user of the Products must obtain their own
* Spine Editor license and redistribution of the Products in any form must
* include this license and copyright notice.
*
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
module spine.threejs {
export class MeshBatcher extends THREE.Mesh {
private static VERTEX_SIZE = 9;
private vertexBuffer: THREE.InterleavedBuffer;
private vertices: Float32Array;
private verticesLength = 0;
private indices: Uint16Array;
private indicesLength = 0;
constructor (maxVertices: number = 10920, materialCustomizer: SkeletonMeshMaterialParametersCustomizer = (parameters) => { }) {
super();
if (maxVertices > 10920) throw new Error("Can't have more than 10920 triangles per batch: " + maxVertices);
let vertices = this.vertices = new Float32Array(maxVertices * MeshBatcher.VERTEX_SIZE);
let indices = this.indices = new Uint16Array(maxVertices * 3);
let geo = new THREE.BufferGeometry();
let vertexBuffer = this.vertexBuffer = new THREE.InterleavedBuffer(vertices, MeshBatcher.VERTEX_SIZE);
vertexBuffer.usage = WebGLRenderingContext.DYNAMIC_DRAW;
geo.setAttribute("position", new THREE.InterleavedBufferAttribute(vertexBuffer, 3, 0, false));
geo.setAttribute("color", new THREE.InterleavedBufferAttribute(vertexBuffer, 4, 3, false));
geo.setAttribute("uv", new THREE.InterleavedBufferAttribute(vertexBuffer, 2, 7, false));
geo.setIndex(new THREE.BufferAttribute(indices, 1));
geo.getIndex().usage = WebGLRenderingContext.DYNAMIC_DRAW;;
geo.drawRange.start = 0;
geo.drawRange.count = 0;
this.geometry = geo;
this.material = new SkeletonMeshMaterial(materialCustomizer);
}
dispose () {
this.geometry.dispose();
if (this.material instanceof THREE.Material)
this.material.dispose();
else if (this.material) {
for (let i = 0; i < this.material.length; i++) {
let material = this.material[i];
if (material instanceof THREE.Material)
material.dispose();
}
}
}
clear () {
let geo = (<THREE.BufferGeometry>this.geometry);
geo.drawRange.start = 0;
geo.drawRange.count = 0;
(<SkeletonMeshMaterial>this.material).uniforms.map.value = null;
}
begin () {
this.verticesLength = 0;
this.indicesLength = 0;
}
canBatch(verticesLength: number, indicesLength: number) {
if (this.indicesLength + indicesLength >= this.indices.byteLength / 2) return false;
if (this.verticesLength + verticesLength >= this.vertices.byteLength / 2) return false;
return true;
}
batch (vertices: ArrayLike<number>, verticesLength: number, indices: ArrayLike<number>, indicesLength: number, z: number = 0) {
let indexStart = this.verticesLength / MeshBatcher.VERTEX_SIZE;
let vertexBuffer = this.vertices;
let i = this.verticesLength;
let j = 0;
for (;j < verticesLength;) {
vertexBuffer[i++] = vertices[j++];
vertexBuffer[i++] = vertices[j++];
vertexBuffer[i++] = z;
vertexBuffer[i++] = vertices[j++];
vertexBuffer[i++] = vertices[j++];
vertexBuffer[i++] = vertices[j++];
vertexBuffer[i++] = vertices[j++];
vertexBuffer[i++] = vertices[j++];
vertexBuffer[i++] = vertices[j++];
}
this.verticesLength = i;
let indicesArray = this.indices;
for (i = this.indicesLength, j = 0; j < indicesLength; i++, j++)
indicesArray[i] = indices[j] + indexStart;
this.indicesLength += indicesLength;
}
end () {
this.vertexBuffer.needsUpdate = this.verticesLength > 0;
this.vertexBuffer.updateRange.offset = 0;
this.vertexBuffer.updateRange.count = this.verticesLength;
let geo = (<THREE.BufferGeometry>this.geometry);
geo.getIndex().needsUpdate = this.indicesLength > 0;
geo.getIndex().updateRange.offset = 0;
geo.getIndex().updateRange.count = this.indicesLength;
geo.drawRange.start = 0;
geo.drawRange.count = this.indicesLength;
}
}
}

View File

@@ -1,316 +0,0 @@
/******************************************************************************
* Spine Runtimes License Agreement
* Last updated January 1, 2020. Replaces all prior versions.
*
* Copyright (c) 2013-2020, Esoteric Software LLC
*
* Integration of the Spine Runtimes into software or otherwise creating
* derivative works of the Spine Runtimes is permitted under the terms and
* conditions of Section 2 of the Spine Editor License Agreement:
* http://esotericsoftware.com/spine-editor-license
*
* Otherwise, it is permitted to integrate the Spine Runtimes into software
* or otherwise create derivative works of the Spine Runtimes (collectively,
* "Products"), provided that each user of the Products must obtain their own
* Spine Editor license and redistribution of the Products in any form must
* include this license and copyright notice.
*
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
module spine.threejs {
export interface SkeletonMeshMaterialParametersCustomizer {
(materialParameters: THREE.ShaderMaterialParameters): void;
}
export class SkeletonMeshMaterial extends THREE.ShaderMaterial {
constructor (customizer: SkeletonMeshMaterialParametersCustomizer) {
let vertexShader = `
attribute vec4 color;
varying vec2 vUv;
varying vec4 vColor;
void main() {
vUv = uv;
vColor = color;
gl_Position = projectionMatrix*modelViewMatrix*vec4(position,1.0);
}
`;
let fragmentShader = `
uniform sampler2D map;
varying vec2 vUv;
varying vec4 vColor;
void main(void) {
gl_FragColor = texture2D(map, vUv)*vColor;
}
`;
let parameters: THREE.ShaderMaterialParameters = {
uniforms: {
map: { type: "t", value: null }
},
vertexShader: vertexShader,
fragmentShader: fragmentShader,
side: THREE.DoubleSide,
transparent: true,
alphaTest: 0.5
};
customizer(parameters);
super(parameters);
};
}
export class SkeletonMesh extends THREE.Object3D {
tempPos: Vector2 = new Vector2();
tempUv: Vector2 = new Vector2();
tempLight = new Color();
tempDark = new Color();
skeleton: Skeleton;
state: AnimationState;
zOffset: number = 0.1;
vertexEffect: VertexEffect;
private batches = new Array<MeshBatcher>();
private nextBatchIndex = 0;
private clipper: SkeletonClipping = new SkeletonClipping();
static QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0];
static VERTEX_SIZE = 2 + 2 + 4;
private vertices = Utils.newFloatArray(1024);
private tempColor = new Color();
private materialCustomizer: SkeletonMeshMaterialParametersCustomizer;
constructor (skeletonData: SkeletonData, materialCustomizer: SkeletonMeshMaterialParametersCustomizer = (parameters) => { }) {
super();
this.materialCustomizer = materialCustomizer;
this.skeleton = new Skeleton(skeletonData);
let animData = new AnimationStateData(skeletonData);
this.state = new AnimationState(animData);
}
update(deltaTime: number) {
let state = this.state;
let skeleton = this.skeleton;
state.update(deltaTime);
state.apply(skeleton);
skeleton.updateWorldTransform();
this.updateGeometry();
}
dispose () {
for (var i = 0; i < this.batches.length; i++) {
this.batches[i].dispose();
}
}
private clearBatches () {
for (var i = 0; i < this.batches.length; i++) {
this.batches[i].clear();
this.batches[i].visible = false;
}
this.nextBatchIndex = 0;
}
private nextBatch () {
if (this.batches.length == this.nextBatchIndex) {
let batch = new MeshBatcher(10920, this.materialCustomizer);
this.add(batch);
this.batches.push(batch);
}
let batch = this.batches[this.nextBatchIndex++];
batch.visible = true;
return batch;
}
private updateGeometry() {
this.clearBatches();
let tempPos = this.tempPos;
let tempUv = this.tempUv;
let tempLight = this.tempLight;
let tempDark = this.tempDark;
var numVertices = 0;
var verticesLength = 0;
var indicesLength = 0;
let blendMode: BlendMode = null;
let clipper = this.clipper;
let vertices: ArrayLike<number> = this.vertices;
let triangles: Array<number> = null;
let uvs: ArrayLike<number> = null;
let drawOrder = this.skeleton.drawOrder;
let batch = this.nextBatch();
batch.begin();
let z = 0;
let zOffset = this.zOffset;
for (let i = 0, n = drawOrder.length; i < n; i++) {
let vertexSize = clipper.isClipping() ? 2 : SkeletonMesh.VERTEX_SIZE;
let slot = drawOrder[i];
if (!slot.bone.active) continue;
let attachment = slot.getAttachment();
let attachmentColor: Color = null;
let texture: ThreeJsTexture = null;
let numFloats = 0;
if (attachment instanceof RegionAttachment) {
let region = <RegionAttachment>attachment;
attachmentColor = region.color;
vertices = this.vertices;
numFloats = vertexSize * 4;
region.computeWorldVertices(slot.bone, vertices, 0, vertexSize);
triangles = SkeletonMesh.QUAD_TRIANGLES;
uvs = region.uvs;
texture = <ThreeJsTexture>(<TextureAtlasRegion>region.region.renderObject).texture;
} else if (attachment instanceof MeshAttachment) {
let mesh = <MeshAttachment>attachment;
attachmentColor = mesh.color;
vertices = this.vertices;
numFloats = (mesh.worldVerticesLength >> 1) * vertexSize;
if (numFloats > vertices.length) {
vertices = this.vertices = spine.Utils.newFloatArray(numFloats);
}
mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, vertexSize);
triangles = mesh.triangles;
uvs = mesh.uvs;
texture = <ThreeJsTexture>(<TextureAtlasRegion>mesh.region.renderObject).texture;
} else if (attachment instanceof ClippingAttachment) {
let clip = <ClippingAttachment>(attachment);
clipper.clipStart(slot, clip);
continue;
} else continue;
if (texture != null) {
let skeleton = slot.bone.skeleton;
let skeletonColor = skeleton.color;
let slotColor = slot.color;
let alpha = skeletonColor.a * slotColor.a * attachmentColor.a;
let color = this.tempColor;
color.set(skeletonColor.r * slotColor.r * attachmentColor.r,
skeletonColor.g * slotColor.g * attachmentColor.g,
skeletonColor.b * slotColor.b * attachmentColor.b,
alpha);
let finalVertices: ArrayLike<number>;
let finalVerticesLength: number;
let finalIndices: ArrayLike<number>;
let finalIndicesLength: number;
if (clipper.isClipping()) {
clipper.clipTriangles(vertices, numFloats, triangles, triangles.length, uvs, color, null, false);
let clippedVertices = clipper.clippedVertices;
let clippedTriangles = clipper.clippedTriangles;
if (this.vertexEffect != null) {
let vertexEffect = this.vertexEffect;
let verts = clippedVertices;
for (let v = 0, n = clippedVertices.length; v < n; v += vertexSize) {
tempPos.x = verts[v];
tempPos.y = verts[v + 1];
tempLight.setFromColor(color);
tempDark.set(0, 0, 0, 0);
tempUv.x = verts[v + 6];
tempUv.y = verts[v + 7];
vertexEffect.transform(tempPos, tempUv, tempLight, tempDark);
verts[v] = tempPos.x;
verts[v + 1] = tempPos.y;
verts[v + 2] = tempLight.r;
verts[v + 3] = tempLight.g;
verts[v + 4] = tempLight.b;
verts[v + 5] = tempLight.a;
verts[v + 6] = tempUv.x;
verts[v + 7] = tempUv.y;
}
}
finalVertices = clippedVertices;
finalVerticesLength = clippedVertices.length;
finalIndices = clippedTriangles;
finalIndicesLength = clippedTriangles.length;
} else {
let verts = vertices;
if (this.vertexEffect != null) {
let vertexEffect = this.vertexEffect;
for (let v = 0, u = 0, n = numFloats; v < n; v += vertexSize, u += 2) {
tempPos.x = verts[v];
tempPos.y = verts[v + 1];
tempLight.setFromColor(color);
tempDark.set(0, 0, 0, 0);
tempUv.x = uvs[u];
tempUv.y = uvs[u + 1];
vertexEffect.transform(tempPos, tempUv, tempLight, tempDark);
verts[v] = tempPos.x;
verts[v + 1] = tempPos.y;
verts[v + 2] = tempLight.r;
verts[v + 3] = tempLight.g;
verts[v + 4] = tempLight.b;
verts[v + 5] = tempLight.a;
verts[v + 6] = tempUv.x;
verts[v + 7] = tempUv.y;
}
} else {
for (let v = 2, u = 0, n = numFloats; v < n; v += vertexSize, u += 2) {
verts[v] = color.r;
verts[v + 1] = color.g;
verts[v + 2] = color.b;
verts[v + 3] = color.a;
verts[v + 4] = uvs[u];
verts[v + 5] = uvs[u + 1];
}
}
finalVertices = vertices;
finalVerticesLength = numFloats;
finalIndices = triangles;
finalIndicesLength = triangles.length;
}
if (finalVerticesLength == 0 || finalIndicesLength == 0)
continue;
// Start new batch if this one can't hold vertices/indices
if (!batch.canBatch(finalVerticesLength, finalIndicesLength)) {
batch.end();
batch = this.nextBatch();
batch.begin();
}
// FIXME per slot blending would require multiple material support
//let slotBlendMode = slot.data.blendMode;
//if (slotBlendMode != blendMode) {
// blendMode = slotBlendMode;
// batcher.setBlendMode(getSourceGLBlendMode(this._gl, blendMode, premultipliedAlpha), getDestGLBlendMode(this._gl, blendMode));
//}
let batchMaterial = <SkeletonMeshMaterial>batch.material;
if (batchMaterial.uniforms.map.value == null) {
batchMaterial.uniforms.map.value = texture.texture;
}
if (batchMaterial.uniforms.map.value != texture.texture) {
batch.end();
batch = this.nextBatch();
batch.begin();
batchMaterial = <SkeletonMeshMaterial>batch.material;
batchMaterial.uniforms.map.value = texture.texture;
}
batchMaterial.needsUpdate = true;
batch.batch(finalVertices, finalVerticesLength, finalIndices, finalIndicesLength, z);
z += zOffset;
}
clipper.clipEndWithSlot(slot);
}
clipper.clipEnd();
batch.end();
}
}
}

View File

@@ -1,72 +0,0 @@
/******************************************************************************
* Spine Runtimes License Agreement
* Last updated January 1, 2020. Replaces all prior versions.
*
* Copyright (c) 2013-2020, Esoteric Software LLC
*
* Integration of the Spine Runtimes into software or otherwise creating
* derivative works of the Spine Runtimes is permitted under the terms and
* conditions of Section 2 of the Spine Editor License Agreement:
* http://esotericsoftware.com/spine-editor-license
*
* Otherwise, it is permitted to integrate the Spine Runtimes into software
* or otherwise create derivative works of the Spine Runtimes (collectively,
* "Products"), provided that each user of the Products must obtain their own
* Spine Editor license and redistribution of the Products in any form must
* include this license and copyright notice.
*
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
module spine.threejs {
export class ThreeJsTexture extends Texture {
texture: THREE.Texture;
constructor (image: HTMLImageElement) {
super(image);
this.texture = new THREE.Texture(image);
this.texture.flipY = false;
this.texture.needsUpdate = true;
}
setFilters (minFilter: TextureFilter, magFilter: TextureFilter) {
this.texture.minFilter = ThreeJsTexture.toThreeJsTextureFilter(minFilter);
this.texture.magFilter = ThreeJsTexture.toThreeJsTextureFilter(magFilter);
}
setWraps (uWrap: TextureWrap, vWrap: TextureWrap) {
this.texture.wrapS = ThreeJsTexture.toThreeJsTextureWrap(uWrap);
this.texture.wrapT = ThreeJsTexture.toThreeJsTextureWrap(vWrap);
}
dispose () {
this.texture.dispose();
}
static toThreeJsTextureFilter(filter: TextureFilter) {
if (filter === TextureFilter.Linear) return THREE.LinearFilter;
else if (filter === TextureFilter.MipMap) return THREE.LinearMipMapLinearFilter; // also includes TextureFilter.MipMapLinearLinear
else if (filter === TextureFilter.MipMapLinearNearest) return THREE.LinearMipMapNearestFilter;
else if (filter === TextureFilter.MipMapNearestLinear) return THREE.NearestMipMapLinearFilter;
else if (filter === TextureFilter.MipMapNearestNearest) return THREE.NearestMipMapNearestFilter;
else if (filter === TextureFilter.Nearest) return THREE.NearestFilter;
else throw new Error("Unknown texture filter: " + filter);
}
static toThreeJsTextureWrap(wrap: TextureWrap) {
if (wrap === TextureWrap.ClampToEdge) return THREE.ClampToEdgeWrapping;
else if (wrap === TextureWrap.MirroredRepeat) return THREE.MirroredRepeatWrapping;
else if (wrap === TextureWrap.Repeat) return THREE.RepeatWrapping;
else throw new Error("Unknown texture wrap: " + wrap);
}
}
}

View File

@@ -1,13 +0,0 @@
import { Geometry } from './core/Geometry';
import { Material } from './materials/Material';
import { Object3D } from './core/Object3D';
import { Scene } from './scenes/Scene';
export namespace SceneUtils {
export function createMultiMaterialObject(
geometry: Geometry,
materials: Material[]
): Object3D;
export function detach( child: Object3D, parent: Object3D, scene: Scene ): void;
export function attach( child: Object3D, scene: Scene, parent: Object3D ): void;
}

View File

@@ -1,180 +0,0 @@
export * from './polyfills';
export * from './renderers/WebGLMultisampleRenderTarget';
export * from './renderers/WebGLRenderTargetCube';
export * from './renderers/WebGLRenderTarget';
export * from './renderers/WebGLRenderer';
export * from './renderers/shaders/ShaderLib';
export * from './renderers/shaders/UniformsLib';
export * from './renderers/shaders/UniformsUtils';
export * from './renderers/shaders/ShaderChunk';
export * from './scenes/FogExp2';
export * from './scenes/Fog';
export * from './scenes/Scene';
export * from './objects/Sprite';
export * from './objects/LOD';
export * from './objects/InstancedMesh';
export * from './objects/SkinnedMesh';
export * from './objects/Skeleton';
export * from './objects/Bone';
export * from './objects/Mesh';
export * from './objects/LineSegments';
export * from './objects/LineLoop';
export * from './objects/Line';
export * from './objects/Points';
export * from './objects/Group';
export * from './textures/VideoTexture';
export * from './textures/DataTexture';
export * from './textures/DataTexture3D';
export * from './textures/CompressedTexture';
export * from './textures/CubeTexture';
export * from './textures/CanvasTexture';
export * from './textures/DepthTexture';
export * from './textures/Texture';
export * from './geometries/Geometries';
export * from './materials/Materials';
export * from './loaders/AnimationLoader';
export * from './loaders/CompressedTextureLoader';
export * from './loaders/DataTextureLoader';
export * from './loaders/CubeTextureLoader';
export * from './loaders/TextureLoader';
export * from './loaders/ObjectLoader';
export * from './loaders/MaterialLoader';
export * from './loaders/BufferGeometryLoader';
export * from './loaders/LoadingManager';
export * from './loaders/ImageLoader';
export * from './loaders/ImageBitmapLoader';
export * from './loaders/FontLoader';
export * from './loaders/FileLoader';
export * from './loaders/Loader';
export * from './loaders/LoaderUtils';
export * from './loaders/Cache';
export * from './loaders/AudioLoader';
export * from './lights/SpotLightShadow';
export * from './lights/SpotLight';
export * from './lights/PointLight';
export * from './lights/RectAreaLight';
export * from './lights/HemisphereLight';
export * from './lights/DirectionalLightShadow';
export * from './lights/DirectionalLight';
export * from './lights/AmbientLight';
export * from './lights/LightShadow';
export * from './lights/Light';
export * from './lights/AmbientLightProbe';
export * from './lights/HemisphereLightProbe';
export * from './lights/LightProbe';
export * from './cameras/StereoCamera';
export * from './cameras/PerspectiveCamera';
export * from './cameras/OrthographicCamera';
export * from './cameras/CubeCamera';
export * from './cameras/ArrayCamera';
export * from './cameras/Camera';
export * from './audio/AudioListener';
export * from './audio/PositionalAudio';
export * from './audio/AudioContext';
export * from './audio/AudioAnalyser';
export * from './audio/Audio';
export * from './animation/tracks/VectorKeyframeTrack';
export * from './animation/tracks/StringKeyframeTrack';
export * from './animation/tracks/QuaternionKeyframeTrack';
export * from './animation/tracks/NumberKeyframeTrack';
export * from './animation/tracks/ColorKeyframeTrack';
export * from './animation/tracks/BooleanKeyframeTrack';
export * from './animation/PropertyMixer';
export * from './animation/PropertyBinding';
export * from './animation/KeyframeTrack';
export * from './animation/AnimationUtils';
export * from './animation/AnimationObjectGroup';
export * from './animation/AnimationMixer';
export * from './animation/AnimationClip';
export * from './core/Uniform';
export * from './core/InstancedBufferGeometry';
export * from './core/BufferGeometry';
export * from './core/Geometry';
export * from './core/InterleavedBufferAttribute';
export * from './core/InstancedInterleavedBuffer';
export * from './core/InterleavedBuffer';
export * from './core/InstancedBufferAttribute';
export * from './core/BufferAttribute';
export * from './core/Face3';
export * from './core/Object3D';
export * from './core/Raycaster';
export * from './core/Layers';
export * from './core/EventDispatcher';
export * from './core/DirectGeometry';
export * from './core/Clock';
export * from './math/interpolants/QuaternionLinearInterpolant';
export * from './math/interpolants/LinearInterpolant';
export * from './math/interpolants/DiscreteInterpolant';
export * from './math/interpolants/CubicInterpolant';
export * from './math/Interpolant';
export * from './math/Triangle';
export { _Math as Math } from './math/Math';
export * from './math/Spherical';
export * from './math/Cylindrical';
export * from './math/Plane';
export * from './math/Frustum';
export * from './math/Sphere';
export * from './math/Ray';
export * from './math/Matrix4';
export * from './math/Matrix3';
export * from './math/Box3';
export * from './math/Box2';
export * from './math/Line3';
export * from './math/Euler';
export * from './math/Vector4';
export * from './math/Vector3';
export * from './math/Vector2';
export * from './math/Quaternion';
export * from './math/Color';
export * from './math/SphericalHarmonics3';
export * from './extras/objects/ImmediateRenderObject';
export * from './helpers/VertexNormalsHelper';
export * from './helpers/SpotLightHelper';
export * from './helpers/SkeletonHelper';
export * from './helpers/PointLightHelper';
export * from './helpers/RectAreaLightHelper';
export * from './helpers/HemisphereLightHelper';
export * from './helpers/GridHelper';
export * from './helpers/PolarGridHelper';
export * from './helpers/PositionalAudioHelper';
export * from './helpers/FaceNormalsHelper';
export * from './helpers/DirectionalLightHelper';
export * from './helpers/CameraHelper';
export * from './helpers/BoxHelper';
export * from './helpers/Box3Helper';
export * from './helpers/PlaneHelper';
export * from './helpers/ArrowHelper';
export * from './helpers/AxesHelper';
export * from './extras/curves/Curves';
export * from './extras/core/Shape';
export * from './extras/core/Path';
export * from './extras/core/ShapePath';
export * from './extras/core/Font';
export * from './extras/core/CurvePath';
export * from './extras/core/Curve';
export * from './extras/ImageUtils';
export * from './extras/ShapeUtils';
export * from './renderers/webgl/WebGLBufferRenderer';
export * from './renderers/webgl/WebGLCapabilities';
export * from './renderers/webgl/WebGLClipping';
export * from './renderers/webgl/WebGLExtensions';
export * from './renderers/webgl/WebGLGeometries';
export * from './renderers/webgl/WebGLIndexedBufferRenderer';
export * from './renderers/webgl/WebGLInfo';
export * from './renderers/webgl/WebGLLights';
export * from './renderers/webgl/WebGLObjects';
export * from './renderers/webgl/WebGLProgram';
export * from './renderers/webgl/WebGLPrograms';
export * from './renderers/webgl/WebGLProperties';
export * from './renderers/webgl/WebGLRenderLists';
export * from './renderers/webgl/WebGLShader';
export * from './renderers/webgl/WebGLShadowMap';
export * from './renderers/webgl/WebGLState';
export * from './renderers/webgl/WebGLTextures';
export * from './renderers/webgl/WebGLUniforms';
//export * from './renderers/webgl/WebGLUtils';
export * from './renderers/webvr/WebVRManager';
export * from './constants';
export * from './Three.Legacy';
export as namespace THREE;

View File

@@ -1,62 +0,0 @@
import { AnimationMixer } from './AnimationMixer';
import { AnimationClip } from './AnimationClip';
import { AnimationActionLoopStyles } from '../constants';
import { Object3D } from '../core/Object3D';
// Animation ////////////////////////////////////////////////////////////////////////////////////////
export class AnimationAction {
constructor( mixer: AnimationMixer, clip: AnimationClip, localRoot?: Object3D );
loop: AnimationActionLoopStyles;
time: number;
timeScale: number;
weight: number;
repetitions: number;
paused: boolean;
enabled: boolean;
clampWhenFinished: boolean;
zeroSlopeAtStart: boolean;
zeroSlopeAtEnd: boolean;
play(): AnimationAction;
stop(): AnimationAction;
reset(): AnimationAction;
isRunning(): boolean;
isScheduled(): boolean;
startAt( time: number ): AnimationAction;
setLoop(
mode: AnimationActionLoopStyles,
repetitions: number
): AnimationAction;
setEffectiveWeight( weight: number ): AnimationAction;
getEffectiveWeight(): number;
fadeIn( duration: number ): AnimationAction;
fadeOut( duration: number ): AnimationAction;
crossFadeFrom(
fadeOutAction: AnimationAction,
duration: number,
warp: boolean
): AnimationAction;
crossFadeTo(
fadeInAction: AnimationAction,
duration: number,
warp: boolean
): AnimationAction;
stopFading(): AnimationAction;
setEffectiveTimeScale( timeScale: number ): AnimationAction;
getEffectiveTimeScale(): number;
setDuration( duration: number ): AnimationAction;
syncWith( action: AnimationAction ): AnimationAction;
halt( duration: number ): AnimationAction;
warp(
statTimeScale: number,
endTimeScale: number,
duration: number
): AnimationAction;
stopWarping(): AnimationAction;
getMixer(): AnimationMixer;
getClip(): AnimationClip;
getRoot(): Object3D;
}

View File

@@ -1,41 +0,0 @@
import { KeyframeTrack } from './KeyframeTrack';
import { Bone } from '../objects/Bone';
import { MorphTarget } from '../core/Geometry';
export class AnimationClip {
constructor( name?: string, duration?: number, tracks?: KeyframeTrack[] );
name: string;
tracks: KeyframeTrack[];
duration: number;
uuid: string;
results: any[];
resetDuration(): AnimationClip;
trim(): AnimationClip;
validate(): boolean;
optimize(): AnimationClip;
clone(): AnimationClip;
static CreateFromMorphTargetSequence(
name: string,
morphTargetSequence: MorphTarget[],
fps: number,
noLoop: boolean
): AnimationClip;
static findByName( clipArray: AnimationClip[], name: string ): AnimationClip;
static CreateClipsFromMorphTargetSequences(
morphTargets: MorphTarget[],
fps: number,
noLoop: boolean
): AnimationClip[];
static parse( json: any ): AnimationClip;
static parseAnimation(
animation: any,
bones: Bone[],
nodeName: string
): AnimationClip;
static toJSON(): any;
}

View File

@@ -1,23 +0,0 @@
import { AnimationClip } from './AnimationClip';
import { AnimationAction } from './AnimationAction';
import { EventDispatcher } from '../core/EventDispatcher';
import { Object3D } from '../core/Object3D';
export class AnimationMixer extends EventDispatcher {
constructor( root: Object3D );
time: number;
timeScale: number;
clipAction( clip: AnimationClip, root?: Object3D ): AnimationAction;
existingAction( clip: AnimationClip, root?: Object3D ): AnimationAction | null;
stopAllAction(): AnimationMixer;
update( deltaTime: number ): AnimationMixer;
setTime( timeInSeconds: number ): AnimationMixer;
getRoot(): Object3D;
uncacheClip( clip: AnimationClip ): void;
uncacheRoot( root: Object3D ): void;
uncacheAction( clip: AnimationClip, root?: Object3D ): void;
}

View File

@@ -1,18 +0,0 @@
export class AnimationObjectGroup {
constructor( ...args: any[] );
uuid: string;
stats: {
bindingsPerObject: number;
objects: {
total: number;
inUse: number;
};
};
add( ...args: any[] ): void;
remove( ...args: any[] ): void;
uncache( ...args: any[] ): void;
}

View File

@@ -1,26 +0,0 @@
import { AnimationClip } from './AnimationClip';
export namespace AnimationUtils {
export function arraySlice( array: any, from: number, to: number ): any;
export function convertArray( array: any, type: any, forceClone: boolean ): any;
export function isTypedArray( object: any ): boolean;
export function getKeyFrameOrder( times: number[] ): number[];
export function sortedArray(
values: any[],
stride: number,
order: number[]
): any[];
export function flattenJSON(
jsonKeys: string[],
times: any[],
values: any[],
valuePropertyName: string
): void;
export function subclip(
sourceClip: AnimationClip,
name: string,
startFrame: number,
endFrame: number,
fps?: number
): AnimationClip;
}

View File

@@ -1,43 +0,0 @@
import { DiscreteInterpolant } from '../math/interpolants/DiscreteInterpolant';
import { LinearInterpolant } from '../math/interpolants/LinearInterpolant';
import { CubicInterpolant } from '../math/interpolants/CubicInterpolant';
import { InterpolationModes } from '../constants';
export class KeyframeTrack {
constructor(
name: string,
times: any[],
values: any[],
interpolation?: InterpolationModes
);
name: string;
times: Float32Array;
values: Float32Array;
ValueTypeName: string;
TimeBufferType: Float32Array;
ValueBufferType: Float32Array;
DefaultInterpolation: InterpolationModes;
InterpolantFactoryMethodDiscrete( result: any ): DiscreteInterpolant;
InterpolantFactoryMethodLinear( result: any ): LinearInterpolant;
InterpolantFactoryMethodSmooth( result: any ): CubicInterpolant;
setInterpolation( interpolation: InterpolationModes ): KeyframeTrack;
getInterpolation(): InterpolationModes;
getValuesize(): number;
shift( timeOffset: number ): KeyframeTrack;
scale( timeScale: number ): KeyframeTrack;
trim( startTime: number, endTime: number ): KeyframeTrack;
validate(): boolean;
optimize(): KeyframeTrack;
clone(): KeyframeTrack;
static toJSON( track: KeyframeTrack ): any;
}

View File

@@ -1,51 +0,0 @@
export interface ParseTrackNameResults {
nodeName: string;
objectName: string;
objectIndex: string;
propertyName: string;
propertyIndex: string;
}
export class PropertyBinding {
constructor( rootNode: any, path: string, parsedPath?: any );
path: string;
parsedPath: any;
node: any;
rootNode: any;
getValue( targetArray: any, offset: number ): any;
setValue( sourceArray: any, offset: number ): void;
bind(): void;
unbind(): void;
BindingType: { [bindingType: string]: number };
Versioning: { [versioning: string]: number };
GetterByBindingType: Function[];
SetterByBindingTypeAndVersioning: Array<Function[]>;
static create(
root: any,
path: any,
parsedPath?: any
): PropertyBinding | PropertyBinding.Composite;
static sanitizeNodeName( name: string ): string;
static parseTrackName( trackName: string ): ParseTrackNameResults;
static findNode( root: any, nodeName: string ): any;
}
export namespace PropertyBinding {
export class Composite {
constructor( targetGroup: any, path: any, parsedPath?: any );
getValue( array: any, offset: number ): any;
setValue( array: any, offset: number ): void;
bind(): void;
unbind(): void;
}
}

View File

@@ -1,17 +0,0 @@
export class PropertyMixer {
constructor( binding: any, typeName: string, valueSize: number );
binding: any;
valueSize: number;
buffer: any;
cumulativeWeight: number;
useCount: number;
referenceCount: number;
accumulate( accuIndex: number, weight: number ): void;
apply( accuIndex: number ): void;
saveOriginalState(): void;
restoreOriginalState(): void;
}

View File

@@ -1,7 +0,0 @@
import { KeyframeTrack } from '../KeyframeTrack';
export class BooleanKeyframeTrack extends KeyframeTrack {
constructor( name: string, times: any[], values: any[] );
}

View File

@@ -1,13 +0,0 @@
import { KeyframeTrack } from '../KeyframeTrack';
import { InterpolationModes } from '../../constants';
export class ColorKeyframeTrack extends KeyframeTrack {
constructor(
name: string,
times: any[],
values: any[],
interpolation?: InterpolationModes
);
}

View File

@@ -1,13 +0,0 @@
import { KeyframeTrack } from '../KeyframeTrack';
import { InterpolationModes } from '../../constants';
export class NumberKeyframeTrack extends KeyframeTrack {
constructor(
name: string,
times: any[],
values: any[],
interpolation?: InterpolationModes
);
}

View File

@@ -1,13 +0,0 @@
import { KeyframeTrack } from '../KeyframeTrack';
import { InterpolationModes } from '../../constants';
export class QuaternionKeyframeTrack extends KeyframeTrack {
constructor(
name: string,
times: any[],
values: any[],
interpolation?: InterpolationModes
);
}

View File

@@ -1,13 +0,0 @@
import { KeyframeTrack } from '../KeyframeTrack';
import { InterpolationModes } from '../../constants';
export class StringKeyframeTrack extends KeyframeTrack {
constructor(
name: string,
times: any[],
values: any[],
interpolation?: InterpolationModes
);
}

View File

@@ -1,13 +0,0 @@
import { KeyframeTrack } from '../KeyframeTrack';
import { InterpolationModes } from '../../constants';
export class VectorKeyframeTrack extends KeyframeTrack {
constructor(
name: string,
times: any[],
values: any[],
interpolation?: InterpolationModes
);
}

View File

@@ -1,70 +0,0 @@
import { Object3D } from '../core/Object3D';
import { AudioListener } from './AudioListener';
import { AudioContext } from './AudioContext';
// Extras / Audio /////////////////////////////////////////////////////////////////////
export class Audio extends Object3D {
constructor( listener: AudioListener );
type: 'Audio';
context: AudioContext;
gain: GainNode;
autoplay: boolean;
buffer: null | Audio;
detune: number;
loop: boolean;
offset: number;
duration: number | undefined;
playbackRate: number;
isPlaying: boolean;
hasPlaybackControl: boolean;
sourceType: string;
source: AudioBufferSourceNode;
filters: any[];
getOutput(): GainNode;
setNodeSource( audioNode: AudioBufferSourceNode ): this;
setMediaElementSource( mediaElement: HTMLMediaElement ): this;
setMediaStreamSource( mediaStream: MediaStream ): this;
setBuffer( audioBuffer: AudioBuffer ): this;
play( delay?: number ): this;
onEnded(): void;
pause(): this;
stop(): this;
connect(): this;
disconnect(): this;
setDetune( value: number ): this;
getDetune(): number;
getFilters(): any[];
setFilter( value: any[] ): this;
getFilter(): any;
setFilter( filter: any ): this;
setPlaybackRate( value: number ): this;
getPlaybackRate(): number;
getLoop(): boolean;
setLoop( value: boolean ): this;
setLoopStart( value: number ): this;
setLoopEnd( value: number ): this;
getVolume(): number;
setVolume( value: number ): this;
/**
* @deprecated Use {@link AudioLoader} instead.
*/
load( file: string ): Audio;
}
export class AudioBuffer {
constructor( context: any );
context: any;
ready: boolean;
readyCallbacks: Function[];
load( file: string ): AudioBuffer;
onReady( callback: Function ): void;
}

View File

@@ -1,16 +0,0 @@
export class AudioAnalyser {
constructor( audio: any, fftSize: number );
analyser: any;
data: Uint8Array;
getFrequencyData(): Uint8Array;
getAverageFrequency(): number;
/**
* @deprecated Use {@link AudioAnalyser#getFrequencyData .getFrequencyData()} instead.
*/
getData( file: any ): any;
}

View File

@@ -1 +0,0 @@
export const AudioContext: AudioContext;

View File

@@ -1,21 +0,0 @@
import { Object3D } from '../core/Object3D';
import { AudioContext } from './AudioContext';
export class AudioListener extends Object3D {
constructor();
type: 'AudioListener';
context: AudioContext;
gain: GainNode;
filter: null | any;
getInput(): GainNode;
removeFilter(): void;
setFilter( value: any ): void;
getFilter(): any;
setMasterVolume( value: number ): void;
getMasterVolume(): number;
updateMatrixWorld( force?: boolean ): void;
}

View File

@@ -1,24 +0,0 @@
import { AudioListener } from './AudioListener';
import { Audio } from './Audio';
export class PositionalAudio extends Audio {
constructor( listener: AudioListener );
panner: PannerNode;
setRefDistance( value: number ): this;
getRefDistance(): number;
setRolloffFactor( value: number ): this;
getRolloffFactor(): number;
setDistanceModel( value: string ): this;
getDistanceModel(): string;
setMaxDistance( value: number ): this;
getMaxDistance(): number;
setDirectionalCone(
coneInnerAngle: number,
coneOuterAngle: number,
coneOuterGain: number
): this;
}

View File

@@ -1,10 +0,0 @@
import { PerspectiveCamera } from './PerspectiveCamera';
export class ArrayCamera extends PerspectiveCamera {
constructor( cameras?: PerspectiveCamera[] );
cameras: PerspectiveCamera[];
isArrayCamera: true;
}

View File

@@ -1,38 +0,0 @@
import { Matrix4 } from '../math/Matrix4';
import { Vector3 } from '../math/Vector3';
import { Object3D } from '../core/Object3D';
// Cameras ////////////////////////////////////////////////////////////////////////////////////////
/**
* Abstract base class for cameras. This class should always be inherited when you build a new camera.
*/
export class Camera extends Object3D {
/**
* This constructor sets following properties to the correct type: matrixWorldInverse, projectionMatrix and projectionMatrixInverse.
*/
constructor();
/**
* This is the inverse of matrixWorld. MatrixWorld contains the Matrix which has the world transform of the Camera.
*/
matrixWorldInverse: Matrix4;
/**
* This is the matrix which contains the projection.
*/
projectionMatrix: Matrix4;
/**
* This is the inverse of projectionMatrix.
*/
projectionMatrixInverse: Matrix4;
isCamera: true;
getWorldDirection( target: Vector3 ): Vector3;
updateMatrixWorld( force?: boolean ): void;
}

View File

@@ -1,19 +0,0 @@
import { WebGLRenderTargetCube } from '../renderers/WebGLRenderTargetCube';
import { WebGLRenderTargetOptions } from '../renderers/WebGLRenderTarget';
import { Scene } from '../scenes/Scene';
import { WebGLRenderer } from '../renderers/WebGLRenderer';
import { Object3D } from '../core/Object3D';
export class CubeCamera extends Object3D {
constructor( near?: number, far?: number, cubeResolution?: number, options?: WebGLRenderTargetOptions );
type: 'CubeCamera';
renderTarget: WebGLRenderTargetCube;
update( renderer: WebGLRenderer, scene: Scene ): void;
clear( renderer: WebGLRenderer, color: boolean, depth: boolean, stencil: boolean ): void;
}

View File

@@ -1,91 +0,0 @@
import { Camera } from './Camera';
/**
* Camera with orthographic projection
*
* @example
* var camera = new THREE.OrthographicCamera( width / - 2, width / 2, height / 2, height / - 2, 1, 1000 );
* scene.add( camera );
*
* @see <a href="https://github.com/mrdoob/three.js/blob/master/src/cameras/OrthographicCamera.js">src/cameras/OrthographicCamera.js</a>
*/
export class OrthographicCamera extends Camera {
/**
* @param left Camera frustum left plane.
* @param right Camera frustum right plane.
* @param top Camera frustum top plane.
* @param bottom Camera frustum bottom plane.
* @param near Camera frustum near plane.
* @param far Camera frustum far plane.
*/
constructor(
left: number,
right: number,
top: number,
bottom: number,
near?: number,
far?: number
);
type: 'OrthographicCamera';
isOrthographicCamera: true;
zoom: number;
view: null | {
enabled: boolean;
fullWidth: number;
fullHeight: number;
offsetX: number;
offsetY: number;
width: number;
height: number;
};
/**
* Camera frustum left plane.
*/
left: number;
/**
* Camera frustum right plane.
*/
right: number;
/**
* Camera frustum top plane.
*/
top: number;
/**
* Camera frustum bottom plane.
*/
bottom: number;
/**
* Camera frustum near plane.
*/
near: number;
/**
* Camera frustum far plane.
*/
far: number;
/**
* Updates the camera projection matrix. Must be called after change of parameters.
*/
updateProjectionMatrix(): void;
setViewOffset(
fullWidth: number,
fullHeight: number,
offsetX: number,
offsetY: number,
width: number,
height: number
): void;
clearViewOffset(): void;
toJSON( meta?: any ): any;
}

View File

@@ -1,121 +0,0 @@
import { Camera } from './Camera';
/**
* Camera with perspective projection.
*
* @source https://github.com/mrdoob/three.js/blob/master/src/cameras/PerspectiveCamera.js
*/
export class PerspectiveCamera extends Camera {
/**
* @param fov Camera frustum vertical field of view. Default value is 50.
* @param aspect Camera frustum aspect ratio. Default value is 1.
* @param near Camera frustum near plane. Default value is 0.1.
* @param far Camera frustum far plane. Default value is 2000.
*/
constructor( fov?: number, aspect?: number, near?: number, far?: number );
type: 'PerspectiveCamera';
isPerspectiveCamera: true;
zoom: number;
/**
* Camera frustum vertical field of view, from bottom to top of view, in degrees.
*/
fov: number;
/**
* Camera frustum aspect ratio, window width divided by window height.
*/
aspect: number;
/**
* Camera frustum near plane.
*/
near: number;
/**
* Camera frustum far plane.
*/
far: number;
focus: number;
view: null | {
enabled: boolean;
fullWidth: number;
fullHeight: number;
offsetX: number;
offsetY: number;
width: number;
height: number;
};
filmGauge: number;
filmOffset: number;
setFocalLength( focalLength: number ): void;
getFocalLength(): number;
getEffectiveFOV(): number;
getFilmWidth(): number;
getFilmHeight(): number;
/**
* Sets an offset in a larger frustum. This is useful for multi-window or multi-monitor/multi-machine setups.
* For example, if you have 3x2 monitors and each monitor is 1920x1080 and the monitors are in grid like this:
*
* +---+---+---+
* | A | B | C |
* +---+---+---+
* | D | E | F |
* +---+---+---+
*
* then for each monitor you would call it like this:
*
* var w = 1920;
* var h = 1080;
* var fullWidth = w * 3;
* var fullHeight = h * 2;
*
* // A
* camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h );
* // B
* camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h );
* // C
* camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h );
* // D
* camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h );
* // E
* camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h );
* // F
* camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h ); Note there is no reason monitors have to be the same size or in a grid.
*
* @param fullWidth full width of multiview setup
* @param fullHeight full height of multiview setup
* @param x horizontal offset of subcamera
* @param y vertical offset of subcamera
* @param width width of subcamera
* @param height height of subcamera
*/
setViewOffset(
fullWidth: number,
fullHeight: number,
x: number,
y: number,
width: number,
height: number
): void;
clearViewOffset(): void;
/**
* Updates the camera projection matrix. Must be called after change of parameters.
*/
updateProjectionMatrix(): void;
toJSON( meta?: any ): any;
/**
* @deprecated Use {@link PerspectiveCamera#setFocalLength .setFocalLength()} and {@link PerspectiveCamera#filmGauge .filmGauge} instead.
*/
setLens( focalLength: number, frameHeight?: number ): void;
}

View File

@@ -1,17 +0,0 @@
import { PerspectiveCamera } from './PerspectiveCamera';
import { Camera } from './Camera';
export class StereoCamera extends Camera {
constructor();
type: 'StereoCamera';
aspect: number;
eyeSep: number;
cameraL: PerspectiveCamera;
cameraR: PerspectiveCamera;
update( camera: PerspectiveCamera ): void;
}

View File

@@ -1,290 +0,0 @@
export const REVISION: string;
// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.button
export enum MOUSE {
LEFT,
MIDDLE,
RIGHT,
ROTATE,
DOLLY,
PAN,
}
export enum TOUCH {
ROTATE,
PAN,
DOLLY_PAN,
DOLLY_ROTATE,
}
// GL STATE CONSTANTS
export enum CullFace {}
export const CullFaceNone: CullFace;
export const CullFaceBack: CullFace;
export const CullFaceFront: CullFace;
export const CullFaceFrontBack: CullFace;
export enum FrontFaceDirection {}
export const FrontFaceDirectionCW: FrontFaceDirection;
export const FrontFaceDirectionCCW: FrontFaceDirection;
// Shadowing Type
export enum ShadowMapType {}
export const BasicShadowMap: ShadowMapType;
export const PCFShadowMap: ShadowMapType;
export const PCFSoftShadowMap: ShadowMapType;
export const VSMShadowMap: ShadowMapType;
// MATERIAL CONSTANTS
// side
export enum Side {}
export const FrontSide: Side;
export const BackSide: Side;
export const DoubleSide: Side;
// shading
export enum Shading {}
export const FlatShading: Shading;
export const SmoothShading: Shading;
// colors
export enum Colors {}
export const NoColors: Colors;
export const FaceColors: Colors;
export const VertexColors: Colors;
// blending modes
export enum Blending {}
export const NoBlending: Blending;
export const NormalBlending: Blending;
export const AdditiveBlending: Blending;
export const SubtractiveBlending: Blending;
export const MultiplyBlending: Blending;
export const CustomBlending: Blending;
// custom blending equations
// (numbers start from 100 not to clash with other
// mappings to OpenGL constants defined in Texture.js)
export enum BlendingEquation {}
export const AddEquation: BlendingEquation;
export const SubtractEquation: BlendingEquation;
export const ReverseSubtractEquation: BlendingEquation;
export const MinEquation: BlendingEquation;
export const MaxEquation: BlendingEquation;
// custom blending destination factors
export enum BlendingDstFactor {}
export const ZeroFactor: BlendingDstFactor;
export const OneFactor: BlendingDstFactor;
export const SrcColorFactor: BlendingDstFactor;
export const OneMinusSrcColorFactor: BlendingDstFactor;
export const SrcAlphaFactor: BlendingDstFactor;
export const OneMinusSrcAlphaFactor: BlendingDstFactor;
export const DstAlphaFactor: BlendingDstFactor;
export const OneMinusDstAlphaFactor: BlendingDstFactor;
export const DstColorFactor: BlendingDstFactor;
export const OneMinusDstColorFactor: BlendingDstFactor;
// custom blending src factors
export enum BlendingSrcFactor {}
export const SrcAlphaSaturateFactor: BlendingSrcFactor;
// depth modes
export enum DepthModes {}
export const NeverDepth: DepthModes;
export const AlwaysDepth: DepthModes;
export const LessDepth: DepthModes;
export const LessEqualDepth: DepthModes;
export const EqualDepth: DepthModes;
export const GreaterEqualDepth: DepthModes;
export const GreaterDepth: DepthModes;
export const NotEqualDepth: DepthModes;
// TEXTURE CONSTANTS
// Operations
export enum Combine {}
export const MultiplyOperation: Combine;
export const MixOperation: Combine;
export const AddOperation: Combine;
// Tone Mapping modes
export enum ToneMapping {}
export const NoToneMapping: ToneMapping;
export const LinearToneMapping: ToneMapping;
export const ReinhardToneMapping: ToneMapping;
export const Uncharted2ToneMapping: ToneMapping;
export const CineonToneMapping: ToneMapping;
export const ACESFilmicToneMapping: ToneMapping;
// Mapping modes
export enum Mapping {}
export const UVMapping: Mapping;
export const CubeReflectionMapping: Mapping;
export const CubeRefractionMapping: Mapping;
export const EquirectangularReflectionMapping: Mapping;
export const EquirectangularRefractionMapping: Mapping;
export const SphericalReflectionMapping: Mapping;
export const CubeUVReflectionMapping: Mapping;
export const CubeUVRefractionMapping: Mapping;
// Wrapping modes
export enum Wrapping {}
export const RepeatWrapping: Wrapping;
export const ClampToEdgeWrapping: Wrapping;
export const MirroredRepeatWrapping: Wrapping;
// Filters
export enum TextureFilter {}
export const NearestFilter: TextureFilter;
export const NearestMipmapNearestFilter: TextureFilter;
export const NearestMipMapNearestFilter: TextureFilter;
export const NearestMipmapLinearFilter: TextureFilter;
export const NearestMipMapLinearFilter: TextureFilter;
export const LinearFilter: TextureFilter;
export const LinearMipmapNearestFilter: TextureFilter;
export const LinearMipMapNearestFilter: TextureFilter;
export const LinearMipmapLinearFilter: TextureFilter;
export const LinearMipMapLinearFilter: TextureFilter;
// Data types
export enum TextureDataType {}
export const UnsignedByteType: TextureDataType;
export const ByteType: TextureDataType;
export const ShortType: TextureDataType;
export const UnsignedShortType: TextureDataType;
export const IntType: TextureDataType;
export const UnsignedIntType: TextureDataType;
export const FloatType: TextureDataType;
export const HalfFloatType: TextureDataType;
// Pixel types
export enum PixelType {}
export const UnsignedShort4444Type: PixelType;
export const UnsignedShort5551Type: PixelType;
export const UnsignedShort565Type: PixelType;
export const UnsignedInt248Type: PixelType;
// Pixel formats
export enum PixelFormat {}
export const AlphaFormat: PixelFormat;
export const RGBFormat: PixelFormat;
export const RGBAFormat: PixelFormat;
export const LuminanceFormat: PixelFormat;
export const LuminanceAlphaFormat: PixelFormat;
export const RGBEFormat: PixelFormat;
export const DepthFormat: PixelFormat;
export const DepthStencilFormat: PixelFormat;
export const RedFormat: PixelFormat;
// Compressed texture formats
// DDS / ST3C Compressed texture formats
export enum CompressedPixelFormat {}
export const RGB_S3TC_DXT1_Format: CompressedPixelFormat;
export const RGBA_S3TC_DXT1_Format: CompressedPixelFormat;
export const RGBA_S3TC_DXT3_Format: CompressedPixelFormat;
export const RGBA_S3TC_DXT5_Format: CompressedPixelFormat;
// PVRTC compressed './texture formats
export const RGB_PVRTC_4BPPV1_Format: CompressedPixelFormat;
export const RGB_PVRTC_2BPPV1_Format: CompressedPixelFormat;
export const RGBA_PVRTC_4BPPV1_Format: CompressedPixelFormat;
export const RGBA_PVRTC_2BPPV1_Format: CompressedPixelFormat;
// ETC compressed texture formats
export const RGB_ETC1_Format: CompressedPixelFormat;
// ASTC compressed texture formats
export const RGBA_ASTC_4x4_Format: CompressedPixelFormat;
export const RGBA_ASTC_5x4_Format: CompressedPixelFormat;
export const RGBA_ASTC_5x5_Format: CompressedPixelFormat;
export const RGBA_ASTC_6x5_Format: CompressedPixelFormat;
export const RGBA_ASTC_6x6_Format: CompressedPixelFormat;
export const RGBA_ASTC_8x5_Format: CompressedPixelFormat;
export const RGBA_ASTC_8x6_Format: CompressedPixelFormat;
export const RGBA_ASTC_8x8_Format: CompressedPixelFormat;
export const RGBA_ASTC_10x5_Format: CompressedPixelFormat;
export const RGBA_ASTC_10x6_Format: CompressedPixelFormat;
export const RGBA_ASTC_10x8_Format: CompressedPixelFormat;
export const RGBA_ASTC_10x10_Format: CompressedPixelFormat;
export const RGBA_ASTC_12x10_Format: CompressedPixelFormat;
export const RGBA_ASTC_12x12_Format: CompressedPixelFormat;
// Loop styles for AnimationAction
export enum AnimationActionLoopStyles {}
export const LoopOnce: AnimationActionLoopStyles;
export const LoopRepeat: AnimationActionLoopStyles;
export const LoopPingPong: AnimationActionLoopStyles;
// Interpolation
export enum InterpolationModes {}
export const InterpolateDiscrete: InterpolationModes;
export const InterpolateLinear: InterpolationModes;
export const InterpolateSmooth: InterpolationModes;
// Interpolant ending modes
export enum InterpolationEndingModes {}
export const ZeroCurvatureEnding: InterpolationEndingModes;
export const ZeroSlopeEnding: InterpolationEndingModes;
export const WrapAroundEnding: InterpolationEndingModes;
// Triangle Draw modes
export enum TrianglesDrawModes {}
export const TrianglesDrawMode: TrianglesDrawModes;
export const TriangleStripDrawMode: TrianglesDrawModes;
export const TriangleFanDrawMode: TrianglesDrawModes;
// Texture Encodings
export enum TextureEncoding {}
export const LinearEncoding: TextureEncoding;
export const sRGBEncoding: TextureEncoding;
export const GammaEncoding: TextureEncoding;
export const RGBEEncoding: TextureEncoding;
export const LogLuvEncoding: TextureEncoding;
export const RGBM7Encoding: TextureEncoding;
export const RGBM16Encoding: TextureEncoding;
export const RGBDEncoding: TextureEncoding;
// Depth packing strategies
export enum DepthPackingStrategies {}
export const BasicDepthPacking: DepthPackingStrategies;
export const RGBADepthPacking: DepthPackingStrategies;
// Normal Map types
export enum NormalMapTypes {}
export const TangentSpaceNormalMap: NormalMapTypes;
export const ObjectSpaceNormalMap: NormalMapTypes;
// Stencil Op types
export enum StencilOp {}
export const ZeroStencilOp: StencilOp;
export const KeepStencilOp: StencilOp;
export const ReplaceStencilOp: StencilOp;
export const IncrementStencilOp: StencilOp;
export const DecrementStencilOp: StencilOp;
export const IncrementWrapStencilOp: StencilOp;
export const DecrementWrapStencilOp: StencilOp;
export const InvertStencilOp: StencilOp;
// Stencil Func types
export enum StencilFunc {}
export const NeverStencilFunc: StencilFunc;
export const LessStencilFunc: StencilFunc;
export const EqualStencilFunc: StencilFunc;
export const LessEqualStencilFunc: StencilFunc;
export const GreaterStencilFunc: StencilFunc;
export const NotEqualStencilFunc: StencilFunc;
export const GreaterEqualStencilFunc: StencilFunc;
export const AlwaysStencilFunc: StencilFunc;
// usage types
export enum Usage {}
export const StaticDrawUsage: Usage;
export const DynamicDrawUsage: Usage;
export const StreamDrawUsage: Usage;
export const StaticReadUsage: Usage;
export const DynamicReadUsage: Usage;
export const StreamReadUsage: Usage;
export const StaticCopyUsage: Usage;
export const DynamicCopyUsage: Usage;
export const StreamCopyUsage: Usage;

View File

@@ -1,245 +0,0 @@
import {
Usage
} from '../constants';
/**
* @see <a href="https://github.com/mrdoob/three.js/blob/master/src/core/BufferAttribute.js">src/core/BufferAttribute.js</a>
*/
export class BufferAttribute {
constructor( array: ArrayLike<number>, itemSize: number, normalized?: boolean ); // array parameter should be TypedArray.
name: string;
array: ArrayLike<number>;
itemSize: number;
usage: Usage;
updateRange: { offset: number; count: number };
version: number;
normalized: boolean;
count: number;
set needsUpdate( value: boolean );
isBufferAttribute: true;
onUploadCallback: () => void;
onUpload( callback: () => void ): this;
setUsage( usage: Usage ): this;
clone(): BufferAttribute;
copy( source: BufferAttribute ): this;
copyAt(
index1: number,
attribute: BufferAttribute,
index2: number
): this;
copyArray( array: ArrayLike<number> ): this;
copyColorsArray(
colors: { r: number; g: number; b: number }[]
): this;
copyVector2sArray( vectors: { x: number; y: number }[] ): this;
copyVector3sArray(
vectors: { x: number; y: number; z: number }[]
): this;
copyVector4sArray(
vectors: { x: number; y: number; z: number; w: number }[]
): this;
set(
value: ArrayLike<number> | ArrayBufferView,
offset?: number
): this;
getX( index: number ): number;
setX( index: number, x: number ): this;
getY( index: number ): number;
setY( index: number, y: number ): this;
getZ( index: number ): number;
setZ( index: number, z: number ): this;
getW( index: number ): number;
setW( index: number, z: number ): this;
setXY( index: number, x: number, y: number ): this;
setXYZ( index: number, x: number, y: number, z: number ): this;
setXYZW(
index: number,
x: number,
y: number,
z: number,
w: number
): this;
toJSON(): {
itemSize: number,
type: string,
array: number[],
normalized: boolean
};
}
/**
* @deprecated THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead.
*/
export class Int8Attribute extends BufferAttribute {
constructor( array: any, itemSize: number );
}
/**
* @deprecated THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead.
*/
export class Uint8Attribute extends BufferAttribute {
constructor( array: any, itemSize: number );
}
/**
* @deprecated THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead.
*/
export class Uint8ClampedAttribute extends BufferAttribute {
constructor( array: any, itemSize: number );
}
/**
* @deprecated THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead.
*/
export class Int16Attribute extends BufferAttribute {
constructor( array: any, itemSize: number );
}
/**
* @deprecated THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead.
*/
export class Uint16Attribute extends BufferAttribute {
constructor( array: any, itemSize: number );
}
/**
* @deprecated THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead.
*/
export class Int32Attribute extends BufferAttribute {
constructor( array: any, itemSize: number );
}
/**
* @deprecated THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead.
*/
export class Uint32Attribute extends BufferAttribute {
constructor( array: any, itemSize: number );
}
/**
* @deprecated THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead.
*/
export class Float32Attribute extends BufferAttribute {
constructor( array: any, itemSize: number );
}
/**
* @deprecated THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead.
*/
export class Float64Attribute extends BufferAttribute {
constructor( array: any, itemSize: number );
}
export class Int8BufferAttribute extends BufferAttribute {
constructor(
array: ArrayLike<number> | ArrayBuffer | number,
itemSize: number,
normalized?: boolean
);
}
export class Uint8BufferAttribute extends BufferAttribute {
constructor(
array: ArrayLike<number> | ArrayBuffer | number,
itemSize: number,
normalized?: boolean
);
}
export class Uint8ClampedBufferAttribute extends BufferAttribute {
constructor(
array: ArrayLike<number> | ArrayBuffer | number,
itemSize: number,
normalized?: boolean
);
}
export class Int16BufferAttribute extends BufferAttribute {
constructor(
array: ArrayLike<number> | ArrayBuffer | number,
itemSize: number,
normalized?: boolean
);
}
export class Uint16BufferAttribute extends BufferAttribute {
constructor(
array: ArrayLike<number> | ArrayBuffer | number,
itemSize: number,
normalized?: boolean
);
}
export class Int32BufferAttribute extends BufferAttribute {
constructor(
array: ArrayLike<number> | ArrayBuffer | number,
itemSize: number,
normalized?: boolean
);
}
export class Uint32BufferAttribute extends BufferAttribute {
constructor(
array: ArrayLike<number> | ArrayBuffer | number,
itemSize: number,
normalized?: boolean
);
}
export class Float32BufferAttribute extends BufferAttribute {
constructor(
array: ArrayLike<number> | ArrayBuffer | number,
itemSize: number,
normalized?: boolean
);
}
export class Float64BufferAttribute extends BufferAttribute {
constructor(
array: ArrayLike<number> | ArrayBuffer | number,
itemSize: number,
normalized?: boolean
);
}

View File

@@ -1,157 +0,0 @@
import { BufferAttribute } from './BufferAttribute';
import { Box3 } from '../math/Box3';
import { Sphere } from '../math/Sphere';
import { Matrix4 } from '../math/Matrix4';
import { Vector2 } from '../math/Vector2';
import { Vector3 } from '../math/Vector3';
import { Object3D } from './Object3D';
import { Geometry } from './Geometry';
import { DirectGeometry } from './DirectGeometry';
import { EventDispatcher } from './EventDispatcher';
import { InterleavedBufferAttribute } from './InterleavedBufferAttribute';
/**
* This is a superefficent class for geometries because it saves all data in buffers.
* It reduces memory costs and cpu cycles. But it is not as easy to work with because of all the nessecary buffer calculations.
* It is mainly interesting when working with static objects.
*
* @see <a href="https://github.com/mrdoob/three.js/blob/master/src/core/BufferGeometry.js">src/core/BufferGeometry.js</a>
*/
export class BufferGeometry extends EventDispatcher {
/**
* This creates a new BufferGeometry. It also sets several properties to an default value.
*/
constructor();
static MaxIndex: number;
/**
* Unique number of this buffergeometry instance
*/
id: number;
uuid: string;
name: string;
type: string;
index: BufferAttribute | null;
attributes: {
[name: string]: BufferAttribute | InterleavedBufferAttribute;
};
morphAttributes: {
[name: string]: ( BufferAttribute | InterleavedBufferAttribute )[];
};
morphTargetsRelative: boolean;
groups: { start: number; count: number; materialIndex?: number }[];
boundingBox: Box3;
boundingSphere: Sphere;
drawRange: { start: number; count: number };
userData: {[key: string]: any};
isBufferGeometry: boolean;
getIndex(): BufferAttribute;
setIndex( index: BufferAttribute | number[] ): void;
setAttribute( name: string, attribute: BufferAttribute | InterleavedBufferAttribute ): BufferGeometry;
getAttribute( name: string ): BufferAttribute | InterleavedBufferAttribute;
deleteAttribute( name: string ): BufferGeometry;
addGroup( start: number, count: number, materialIndex?: number ): void;
clearGroups(): void;
setDrawRange( start: number, count: number ): void;
/**
* Bakes matrix transform directly into vertex coordinates.
*/
applyMatrix( matrix: Matrix4 ): BufferGeometry;
rotateX( angle: number ): BufferGeometry;
rotateY( angle: number ): BufferGeometry;
rotateZ( angle: number ): BufferGeometry;
translate( x: number, y: number, z: number ): BufferGeometry;
scale( x: number, y: number, z: number ): BufferGeometry;
lookAt( v: Vector3 ): void;
center(): BufferGeometry;
setFromObject( object: Object3D ): BufferGeometry;
setFromPoints( points: Vector3[] | Vector2[] ): BufferGeometry;
updateFromObject( object: Object3D ): void;
fromGeometry( geometry: Geometry, settings?: any ): BufferGeometry;
fromDirectGeometry( geometry: DirectGeometry ): BufferGeometry;
/**
* Computes bounding box of the geometry, updating Geometry.boundingBox attribute.
* Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null.
*/
computeBoundingBox(): void;
/**
* Computes bounding sphere of the geometry, updating Geometry.boundingSphere attribute.
* Bounding spheres aren't' computed by default. They need to be explicitly computed, otherwise they are null.
*/
computeBoundingSphere(): void;
/**
* Computes vertex normals by averaging face normals.
*/
computeVertexNormals(): void;
merge( geometry: BufferGeometry, offset: number ): BufferGeometry;
normalizeNormals(): void;
toNonIndexed(): BufferGeometry;
toJSON(): any;
clone(): this;
copy( source: BufferGeometry ): this;
/**
* Disposes the object from memory.
* You need to call this when you want the bufferGeometry removed while the application is running.
*/
dispose(): void;
/**
* @deprecated Use {@link BufferGeometry#groups .groups} instead.
*/
drawcalls: any;
/**
* @deprecated Use {@link BufferGeometry#groups .groups} instead.
*/
offsets: any;
/**
* @deprecated Use {@link BufferGeometry#setIndex .setIndex()} instead.
*/
addIndex( index: any ): void;
/**
* @deprecated Use {@link BufferGeometry#addGroup .addGroup()} instead.
*/
addDrawCall( start: any, count: any, indexOffset?: any ): void;
/**
* @deprecated Use {@link BufferGeometry#clearGroups .clearGroups()} instead.
*/
clearDrawCalls(): void;
/**
* @deprecated Use {@link BufferGeometry#setAttribute .setAttribute()} instead.
*/
addAttribute(
name: string,
attribute: BufferAttribute | InterleavedBufferAttribute
): BufferGeometry;
/**
* @deprecated Use {@link BufferGeometry#deleteAttribute .deleteAttribute()} instead.
*/
removeAttribute( name: string ): BufferGeometry;
addAttribute( name: any, array: any, itemSize: any ): any;
}

View File

@@ -1,61 +0,0 @@
/**
* Object for keeping track of time.
*
* @see <a href="https://github.com/mrdoob/three.js/blob/master/src/core/Clock.js">src/core/Clock.js</a>
*/
export class Clock {
/**
* @param autoStart Automatically start the clock.
*/
constructor( autoStart?: boolean );
/**
* If set, starts the clock automatically when the first update is called.
*/
autoStart: boolean;
/**
* When the clock is running, It holds the starttime of the clock.
* This counted from the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.
*/
startTime: number;
/**
* When the clock is running, It holds the previous time from a update.
* This counted from the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.
*/
oldTime: number;
/**
* When the clock is running, It holds the time elapsed between the start of the clock to the previous update.
* This parameter is in seconds of three decimal places.
*/
elapsedTime: number;
/**
* This property keeps track whether the clock is running or not.
*/
running: boolean;
/**
* Starts clock.
*/
start(): void;
/**
* Stops clock.
*/
stop(): void;
/**
* Get the seconds passed since the clock started.
*/
getElapsedTime(): number;
/**
* Get the seconds passed since the last call to this method.
*/
getDelta(): number;
}

View File

@@ -1,44 +0,0 @@
import { Vector3 } from '../math/Vector3';
import { Color } from '../math/Color';
import { Vector2 } from '../math/Vector2';
import { Vector4 } from '../math/Vector4';
import { Box3 } from '../math/Box3';
import { Sphere } from '../math/Sphere';
import { Geometry } from './Geometry';
import { MorphTarget } from './Geometry';
/**
* @see <a href="https://github.com/mrdoob/three.js/blob/master/src/core/DirectGeometry.js">src/core/DirectGeometry.js</a>
*/
export class DirectGeometry {
constructor();
id: number;
uuid: string;
name: string;
type: string;
indices: number[];
vertices: Vector3[];
normals: Vector3[];
colors: Color[];
uvs: Vector2[];
uvs2: Vector2[];
groups: { start: number; materialIndex: number }[];
morphTargets: MorphTarget[];
skinWeights: Vector4[];
skinIndices: Vector4[];
boundingBox: Box3;
boundingSphere: Sphere;
verticesNeedUpdate: boolean;
normalsNeedUpdate: boolean;
colorsNeedUpdate: boolean;
uvsNeedUpdate: boolean;
groupsNeedUpdate: boolean;
computeBoundingBox(): void;
computeBoundingSphere(): void;
computeGroups( geometry: Geometry ): void;
fromGeometry( geometry: Geometry ): DirectGeometry;
dispose(): void;
}

View File

@@ -1,42 +0,0 @@
import { Event } from './Face3';
/**
* JavaScript events for custom objects
*
* @source src/core/EventDispatcher.js
*/
export class EventDispatcher {
/**
* Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.
*/
constructor();
/**
* Adds a listener to an event type.
* @param type The type of event to listen to.
* @param listener The function that gets called when the event is fired.
*/
addEventListener( type: string, listener: ( event: Event ) => void ): void;
/**
* Checks if listener is added to an event type.
* @param type The type of event to listen to.
* @param listener The function that gets called when the event is fired.
*/
hasEventListener( type: string, listener: ( event: Event ) => void ): boolean;
/**
* Removes a listener from an event type.
* @param type The type of the listener that gets removed.
* @param listener The listener function that gets removed.
*/
removeEventListener( type: string, listener: ( event: Event ) => void ): void;
/**
* Fire an event type.
* @param type The type of event that gets fired.
*/
dispatchEvent( event: { type: string; [attachment: string]: any } ): void;
}

View File

@@ -1,101 +0,0 @@
import { Vector3 } from '../math/Vector3';
import { Color } from '../math/Color';
export interface Event {
type: string;
target?: any;
[attachment: string]: any;
}
/**
* Triangle face.
*
* @source https://github.com/mrdoob/three.js/blob/master/src/core/Face3.js
*/
export class Face3 {
/**
* @param a Vertex A index.
* @param b Vertex B index.
* @param c Vertex C index.
* @param normal Face normal or array of vertex normals.
* @param color Face color or array of vertex colors.
* @param materialIndex Material index.
*/
constructor(
a: number,
b: number,
c: number,
normal?: Vector3,
color?: Color,
materialIndex?: number
);
constructor(
a: number,
b: number,
c: number,
normal?: Vector3,
vertexColors?: Color[],
materialIndex?: number
);
constructor(
a: number,
b: number,
c: number,
vertexNormals?: Vector3[],
color?: Color,
materialIndex?: number
);
constructor(
a: number,
b: number,
c: number,
vertexNormals?: Vector3[],
vertexColors?: Color[],
materialIndex?: number
);
/**
* Vertex A index.
*/
a: number;
/**
* Vertex B index.
*/
b: number;
/**
* Vertex C index.
*/
c: number;
/**
* Face normal.
*/
normal: Vector3;
/**
* Array of 4 vertex normals.
*/
vertexNormals: Vector3[];
/**
* Face color.
*/
color: Color;
/**
* Array of 4 vertex normals.
*/
vertexColors: Color[];
/**
* Material index (points to {@link Geometry.materials}).
*/
materialIndex: number;
clone(): this;
copy( source: Face3 ): this;
}

View File

@@ -1,255 +0,0 @@
import { Vector3 } from '../math/Vector3';
import { Color } from '../math/Color';
import { Face3 } from './Face3';
import { Vector2 } from '../math/Vector2';
import { Vector4 } from '../math/Vector4';
import { Box3 } from '../math/Box3';
import { Sphere } from '../math/Sphere';
import { Matrix4 } from '../math/Matrix4';
import { BufferGeometry } from './BufferGeometry';
import { Matrix } from '../math/Matrix3';
import { Mesh } from '../objects/Mesh';
import { Bone } from '../objects/Bone';
import { AnimationClip } from '../animation/AnimationClip';
import { EventDispatcher } from './EventDispatcher';
/**
* @deprecated Use {@link Face3} instead.
*/
export interface MorphTarget {
name: string;
vertices: Vector3[];
}
export interface MorphColor {
name: string;
colors: Color[];
}
export interface MorphNormals {
name: string;
normals: Vector3[];
}
export let GeometryIdCount: number;
/**
* Base class for geometries
*
* @see https://github.com/mrdoob/three.js/blob/master/src/core/Geometry.js
*/
export class Geometry extends EventDispatcher {
constructor();
/**
* Unique number of this geometry instance
*/
id: number;
uuid: string;
isGeometry: boolean;
/**
* Name for this geometry. Default is an empty string.
*/
name: string;
type: string;
/**
* The array of vertices hold every position of points of the model.
* To signal an update in this array, Geometry.verticesNeedUpdate needs to be set to true.
*/
vertices: Vector3[];
/**
* Array of vertex colors, matching number and order of vertices.
* Used in ParticleSystem, Line and Ribbon.
* Meshes use per-face-use-of-vertex colors embedded directly in faces.
* To signal an update in this array, Geometry.colorsNeedUpdate needs to be set to true.
*/
colors: Color[];
/**
* Array of triangles or/and quads.
* The array of faces describe how each vertex in the model is connected with each other.
* To signal an update in this array, Geometry.elementsNeedUpdate needs to be set to true.
*/
faces: Face3[];
/**
* Array of face UV layers.
* Each UV layer is an array of UV matching order and number of vertices in faces.
* To signal an update in this array, Geometry.uvsNeedUpdate needs to be set to true.
*/
faceVertexUvs: Vector2[][][];
/**
* Array of morph targets. Each morph target is a Javascript object:
*
* { name: "targetName", vertices: [ new THREE.Vector3(), ... ] }
*
* Morph vertices match number and order of primary vertices.
*/
morphTargets: MorphTarget[];
/**
* Array of morph normals. Morph normals have similar structure as morph targets, each normal set is a Javascript object:
*
* morphNormal = { name: "NormalName", normals: [ new THREE.Vector3(), ... ] }
*/
morphNormals: MorphNormals[];
/**
* Array of skinning weights, matching number and order of vertices.
*/
skinWeights: Vector4[];
/**
* Array of skinning indices, matching number and order of vertices.
*/
skinIndices: Vector4[];
/**
*
*/
lineDistances: number[];
/**
* Bounding box.
*/
boundingBox: Box3;
/**
* Bounding sphere.
*/
boundingSphere: Sphere;
/**
* Set to true if the vertices array has been updated.
*/
verticesNeedUpdate: boolean;
/**
* Set to true if the faces array has been updated.
*/
elementsNeedUpdate: boolean;
/**
* Set to true if the uvs array has been updated.
*/
uvsNeedUpdate: boolean;
/**
* Set to true if the normals array has been updated.
*/
normalsNeedUpdate: boolean;
/**
* Set to true if the colors array has been updated.
*/
colorsNeedUpdate: boolean;
/**
* Set to true if the linedistances array has been updated.
*/
lineDistancesNeedUpdate: boolean;
/**
*
*/
groupsNeedUpdate: boolean;
/**
* Bakes matrix transform directly into vertex coordinates.
*/
applyMatrix( matrix: Matrix4 ): Geometry;
rotateX( angle: number ): Geometry;
rotateY( angle: number ): Geometry;
rotateZ( angle: number ): Geometry;
translate( x: number, y: number, z: number ): Geometry;
scale( x: number, y: number, z: number ): Geometry;
lookAt( vector: Vector3 ): void;
fromBufferGeometry( geometry: BufferGeometry ): Geometry;
center(): Geometry;
normalize(): Geometry;
/**
* Computes face normals.
*/
computeFaceNormals(): void;
/**
* Computes vertex normals by averaging face normals.
* Face normals must be existing / computed beforehand.
*/
computeVertexNormals( areaWeighted?: boolean ): void;
/**
* Compute vertex normals, but duplicating face normals.
*/
computeFlatVertexNormals(): void;
/**
* Computes morph normals.
*/
computeMorphNormals(): void;
/**
* Computes bounding box of the geometry, updating {@link Geometry.boundingBox} attribute.
*/
computeBoundingBox(): void;
/**
* Computes bounding sphere of the geometry, updating Geometry.boundingSphere attribute.
* Neither bounding boxes or bounding spheres are computed by default. They need to be explicitly computed, otherwise they are null.
*/
computeBoundingSphere(): void;
merge(
geometry: Geometry,
matrix?: Matrix,
materialIndexOffset?: number
): void;
mergeMesh( mesh: Mesh ): void;
/**
* Checks for duplicate vertices using hashmap.
* Duplicated vertices are removed and faces' vertices are updated.
*/
mergeVertices(): number;
setFromPoints( points: Array<Vector2> | Array<Vector3> ): this;
sortFacesByMaterialIndex(): void;
toJSON(): any;
/**
* Creates a new clone of the Geometry.
*/
clone(): this;
copy( source: Geometry ): this;
/**
* Removes The object from memory.
* Don't forget to call this method when you remove an geometry because it can cuase meomory leaks.
*/
dispose(): void;
// These properties do not exist in a normal Geometry class, but if you use the instance that was passed by JSONLoader, it will be added.
bones: Bone[];
animation: AnimationClip;
animations: AnimationClip[];
}

View File

@@ -1,49 +0,0 @@
import { BufferGeometry } from './BufferGeometry';
import { BufferAttribute } from './BufferAttribute';
/**
* @see <a href="https://github.com/mrdoob/three.js/blob/master/examples/js/BufferGeometryUtils.js">examples/js/BufferGeometryUtils.js</a>
*/
export namespace BufferGeometryUtils {
export function mergeBufferGeometries(
geometries: BufferGeometry[]
): BufferGeometry;
export function computeTangents( geometry: BufferGeometry ): null;
export function mergeBufferAttributes(
attributes: BufferAttribute[]
): BufferAttribute;
}
/**
* @deprecated
*/
export namespace GeometryUtils {
/**
* @deprecated Use {@link Geometry#merge geometry.merge( geometry2, matrix, materialIndexOffset )} instead.
*/
export function merge(
geometry1: any,
geometry2: any,
materialIndexOffset?: any
): any;
/**
* @deprecated Use {@link Geometry#center geometry.center()} instead.
*/
export function center( geometry: any ): any;
}
/**
* @see <a href="https://github.com/mrdoob/three.js/blob/master/src/core/InstancedBufferAttribute.js">src/core/InstancedBufferAttribute.js</a>
*/
export class InstancedBufferAttribute extends BufferAttribute {
constructor(
array: ArrayLike<number>,
itemSize: number,
normalized?: boolean,
meshPerAttribute?: number
);
meshPerAttribute: number;
}

View File

@@ -1,15 +0,0 @@
import { BufferGeometry } from './BufferGeometry';
/**
* @see <a href="https://github.com/mrdoob/three.js/blob/master/src/core/InstancedBufferGeometry.js">src/core/InstancedBufferGeometry.js</a>
*/
export class InstancedBufferGeometry extends BufferGeometry {
constructor();
groups: { start: number; count: number; instances: number }[];
maxInstancedCount: number;
addGroup( start: number, count: number, instances: number ): void;
}

View File

@@ -1,16 +0,0 @@
import { InterleavedBuffer } from './InterleavedBuffer';
/**
* @see <a href="https://github.com/mrdoob/three.js/blob/master/src/core/InstancedInterleavedBuffer.js">src/core/InstancedInterleavedBuffer.js</a>
*/
export class InstancedInterleavedBuffer extends InterleavedBuffer {
constructor(
array: ArrayLike<number>,
stride: number,
meshPerAttribute?: number
);
meshPerAttribute: number;
}

Some files were not shown because too many files have changed in this diff Show More