mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
Merge branch '3.6' into 3.7-beta
This commit is contained in:
commit
f4b3d6ddab
Binary file not shown.
@ -35,8 +35,7 @@ package spine.animation {
|
|||||||
import spine.Skeleton;
|
import spine.Skeleton;
|
||||||
import spine.Slot;
|
import spine.Slot;
|
||||||
|
|
||||||
public class DeformTimeline extends CurveTimeline {
|
public class DeformTimeline extends CurveTimeline {
|
||||||
private static var zeros : Vector.<Number> = new Vector.<Number>(64);
|
|
||||||
public var slotIndex : int;
|
public var slotIndex : int;
|
||||||
public var frames : Vector.<Number>;
|
public var frames : Vector.<Number>;
|
||||||
public var frameVertices : Vector.<Vector.<Number>>;
|
public var frameVertices : Vector.<Vector.<Number>>;
|
||||||
@ -66,10 +65,11 @@ package spine.animation {
|
|||||||
if (!(slotAttachment is VertexAttachment) || !(VertexAttachment(slotAttachment)).applyDeform(attachment)) return;
|
if (!(slotAttachment is VertexAttachment) || !(VertexAttachment(slotAttachment)).applyDeform(attachment)) return;
|
||||||
|
|
||||||
var verticesArray : Vector.<Number> = slot.attachmentVertices;
|
var verticesArray : Vector.<Number> = slot.attachmentVertices;
|
||||||
|
if (verticesArray.length == 0) alpha = 1;
|
||||||
|
|
||||||
var frameVertices : Vector.<Vector.<Number>> = this.frameVertices;
|
var frameVertices : Vector.<Vector.<Number>> = this.frameVertices;
|
||||||
var vertexCount : int = frameVertices[0].length;
|
var vertexCount : int = frameVertices[0].length;
|
||||||
verticesArray.length = vertexCount;
|
var vertices : Vector.<Number>;
|
||||||
var vertices : Vector.<Number> = verticesArray;
|
|
||||||
|
|
||||||
var frames : Vector.<Number> = this.frames;
|
var frames : Vector.<Number> = this.frames;
|
||||||
var i : int;
|
var i : int;
|
||||||
@ -77,20 +77,15 @@ package spine.animation {
|
|||||||
vertexAttachment = VertexAttachment(slotAttachment);
|
vertexAttachment = VertexAttachment(slotAttachment);
|
||||||
switch (pose) {
|
switch (pose) {
|
||||||
case MixPose.setup:
|
case MixPose.setup:
|
||||||
var zeroVertices : Vector.<Number>;
|
verticesArray.length = 0;
|
||||||
if (vertexAttachment.bones == null) {
|
|
||||||
// Unweighted vertex positions (setup pose).
|
|
||||||
zeroVertices = vertexAttachment.vertices;
|
|
||||||
} else {
|
|
||||||
// Weighted deform offsets (zeros).
|
|
||||||
zeroVertices = zeros;
|
|
||||||
if (zeroVertices.length < vertexCount) zeros = zeroVertices = new Vector.<Number>(vertexCount);
|
|
||||||
}
|
|
||||||
for (i = 0; i < vertexCount; i++)
|
|
||||||
vertices[i] = zeroVertices[i];
|
|
||||||
return;
|
return;
|
||||||
case MixPose.current:
|
case MixPose.current:
|
||||||
if (alpha == 1) break;
|
if (alpha == 1) {
|
||||||
|
verticesArray.length = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
verticesArray.length = vertexCount;
|
||||||
|
vertices = verticesArray;
|
||||||
if (vertexAttachment.bones == null) {
|
if (vertexAttachment.bones == null) {
|
||||||
// Unweighted vertex positions.
|
// Unweighted vertex positions.
|
||||||
setupVertices = vertexAttachment.vertices;
|
setupVertices = vertexAttachment.vertices;
|
||||||
@ -106,6 +101,8 @@ package spine.animation {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
verticesArray.length = vertexCount;
|
||||||
|
vertices = verticesArray;
|
||||||
var n : int;
|
var n : int;
|
||||||
var setup : Number, prev : Number;
|
var setup : Number, prev : Number;
|
||||||
if (time >= frames[frames.length - 1]) { // Time is after last frame.
|
if (time >= frames[frames.length - 1]) { // Time is after last frame.
|
||||||
|
|||||||
@ -851,7 +851,7 @@ void _spDeformTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton,
|
|||||||
slot->attachmentVerticesCapacity = vertexCount;
|
slot->attachmentVerticesCapacity = vertexCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
slot->attachmentVerticesCount = vertexCount;
|
if (slot->attachmentVerticesCount == 0) alpha = 1;
|
||||||
|
|
||||||
frameVertices = self->frameVertices;
|
frameVertices = self->frameVertices;
|
||||||
vertices = slot->attachmentVertices;
|
vertices = slot->attachmentVertices;
|
||||||
@ -860,15 +860,15 @@ void _spDeformTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton,
|
|||||||
spVertexAttachment* vertexAttachment = SUB_CAST(spVertexAttachment, slot->attachment);
|
spVertexAttachment* vertexAttachment = SUB_CAST(spVertexAttachment, slot->attachment);
|
||||||
switch (pose) {
|
switch (pose) {
|
||||||
case SP_MIX_POSE_SETUP:
|
case SP_MIX_POSE_SETUP:
|
||||||
if (!vertexAttachment->bones) {
|
slot->attachmentVerticesCount = 0;
|
||||||
memcpy(vertices, vertexAttachment->vertices, vertexCount * sizeof(float));
|
|
||||||
} else {
|
|
||||||
for (i = 0; i < vertexCount; i++) vertices[i] = 0;
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
case SP_MIX_POSE_CURRENT:
|
case SP_MIX_POSE_CURRENT:
|
||||||
case SP_MIX_POSE_CURRENT_LAYERED: /* to appease compiler */
|
case SP_MIX_POSE_CURRENT_LAYERED: /* to appease compiler */
|
||||||
if (alpha == 1) break;
|
if (alpha == 1) {
|
||||||
|
slot->attachmentVerticesCount = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
slot->attachmentVerticesCount = vertexCount;
|
||||||
if (!vertexAttachment->bones) {
|
if (!vertexAttachment->bones) {
|
||||||
float* setupVertices = vertexAttachment->vertices;
|
float* setupVertices = vertexAttachment->vertices;
|
||||||
for (i = 0; i < vertexCount; i++) {
|
for (i = 0; i < vertexCount; i++) {
|
||||||
@ -884,6 +884,7 @@ void _spDeformTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
slot->attachmentVerticesCount = vertexCount;
|
||||||
if (time >= frames[framesCount - 1]) { /* Time is after last frame. */
|
if (time >= frames[framesCount - 1]) { /* Time is after last frame. */
|
||||||
const float* lastVertices = self->frameVertices[framesCount - 1];
|
const float* lastVertices = self->frameVertices[framesCount - 1];
|
||||||
if (alpha == 1) {
|
if (alpha == 1) {
|
||||||
|
|||||||
@ -797,8 +797,6 @@ namespace Spine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class DeformTimeline : CurveTimeline {
|
public class DeformTimeline : CurveTimeline {
|
||||||
static float[] zeros = new float[64];
|
|
||||||
|
|
||||||
internal int slotIndex;
|
internal int slotIndex;
|
||||||
internal float[] frames;
|
internal float[] frames;
|
||||||
internal float[][] frameVertices;
|
internal float[][] frameVertices;
|
||||||
@ -831,30 +829,30 @@ namespace Spine {
|
|||||||
if (vertexAttachment == null || !vertexAttachment.ApplyDeform(attachment)) return;
|
if (vertexAttachment == null || !vertexAttachment.ApplyDeform(attachment)) return;
|
||||||
|
|
||||||
var verticesArray = slot.attachmentVertices;
|
var verticesArray = slot.attachmentVertices;
|
||||||
|
if (verticesArray.Count == 0) alpha = 1;
|
||||||
|
|
||||||
float[][] frameVertices = this.frameVertices;
|
float[][] frameVertices = this.frameVertices;
|
||||||
int vertexCount = frameVertices[0].Length;
|
int vertexCount = frameVertices[0].Length;
|
||||||
if (verticesArray.Capacity < vertexCount) verticesArray.Capacity = vertexCount; // verticesArray.SetSize(vertexCount) // Ensure size and preemptively set count.
|
|
||||||
verticesArray.Count = vertexCount;
|
|
||||||
float[] vertices = verticesArray.Items;
|
|
||||||
|
|
||||||
float[] frames = this.frames;
|
float[] frames = this.frames;
|
||||||
|
float[] vertices;
|
||||||
|
|
||||||
if (time < frames[0]) {
|
if (time < frames[0]) {
|
||||||
|
|
||||||
switch (pose) {
|
switch (pose) {
|
||||||
case MixPose.Setup:
|
case MixPose.Setup:
|
||||||
float[] zeroVertices;
|
verticesArray.Clear();
|
||||||
if (vertexAttachment.bones == null) {
|
|
||||||
// Unweighted vertex positions (setup pose).
|
|
||||||
zeroVertices = vertexAttachment.vertices;
|
|
||||||
} else {
|
|
||||||
// Weighted deform offsets (zeros).
|
|
||||||
zeroVertices = DeformTimeline.zeros;
|
|
||||||
if (zeroVertices.Length < vertexCount) DeformTimeline.zeros = zeroVertices = new float[vertexCount];
|
|
||||||
}
|
|
||||||
Array.Copy(zeroVertices, 0, vertices, 0, vertexCount);
|
|
||||||
return;
|
return;
|
||||||
case MixPose.Current:
|
case MixPose.Current:
|
||||||
if (alpha == 1) return;
|
if (alpha == 1) {
|
||||||
|
verticesArray.Clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// verticesArray.SetSize(vertexCount) // Ensure size and preemptively set count.
|
||||||
|
if (verticesArray.Capacity < vertexCount) verticesArray.Capacity = vertexCount;
|
||||||
|
verticesArray.Count = vertexCount;
|
||||||
|
vertices = verticesArray.Items;
|
||||||
|
|
||||||
if (vertexAttachment.bones == null) {
|
if (vertexAttachment.bones == null) {
|
||||||
// Unweighted vertex positions.
|
// Unweighted vertex positions.
|
||||||
float[] setupVertices = vertexAttachment.vertices;
|
float[] setupVertices = vertexAttachment.vertices;
|
||||||
@ -873,6 +871,11 @@ namespace Spine {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// verticesArray.SetSize(vertexCount) // Ensure size and preemptively set count.
|
||||||
|
if (verticesArray.Capacity < vertexCount) verticesArray.Capacity = vertexCount;
|
||||||
|
verticesArray.Count = vertexCount;
|
||||||
|
vertices = verticesArray.Items;
|
||||||
|
|
||||||
if (time >= frames[frames.Length - 1]) { // Time is after last frame.
|
if (time >= frames[frames.Length - 1]) { // Time is after last frame.
|
||||||
float[] lastVertices = frameVertices[frames.Length - 1];
|
float[] lastVertices = frameVertices[frames.Length - 1];
|
||||||
if (alpha == 1) {
|
if (alpha == 1) {
|
||||||
|
|||||||
@ -862,8 +862,6 @@ public class Animation {
|
|||||||
|
|
||||||
/** Changes a slot's {@link Slot#getAttachmentVertices()} to deform a {@link VertexAttachment}. */
|
/** Changes a slot's {@link Slot#getAttachmentVertices()} to deform a {@link VertexAttachment}. */
|
||||||
static public class DeformTimeline extends CurveTimeline {
|
static public class DeformTimeline extends CurveTimeline {
|
||||||
static private float[] zeros = new float[64];
|
|
||||||
|
|
||||||
int slotIndex;
|
int slotIndex;
|
||||||
VertexAttachment attachment;
|
VertexAttachment attachment;
|
||||||
private final float[] frames; // time, ...
|
private final float[] frames; // time, ...
|
||||||
@ -923,28 +921,24 @@ public class Animation {
|
|||||||
if (!(slotAttachment instanceof VertexAttachment) || !((VertexAttachment)slotAttachment).applyDeform(attachment)) return;
|
if (!(slotAttachment instanceof VertexAttachment) || !((VertexAttachment)slotAttachment).applyDeform(attachment)) return;
|
||||||
|
|
||||||
FloatArray verticesArray = slot.getAttachmentVertices();
|
FloatArray verticesArray = slot.getAttachmentVertices();
|
||||||
|
if (verticesArray.size == 0) alpha = 1;
|
||||||
|
|
||||||
float[][] frameVertices = this.frameVertices;
|
float[][] frameVertices = this.frameVertices;
|
||||||
int vertexCount = frameVertices[0].length;
|
int vertexCount = frameVertices[0].length;
|
||||||
float[] vertices = verticesArray.setSize(vertexCount);
|
|
||||||
|
|
||||||
float[] frames = this.frames;
|
float[] frames = this.frames;
|
||||||
if (time < frames[0]) { // Time is before first frame.
|
if (time < frames[0]) { // Time is before first frame.
|
||||||
VertexAttachment vertexAttachment = (VertexAttachment)slotAttachment;
|
VertexAttachment vertexAttachment = (VertexAttachment)slotAttachment;
|
||||||
switch (pose) {
|
switch (pose) {
|
||||||
case setup:
|
case setup:
|
||||||
float[] zeroVertices;
|
verticesArray.clear();
|
||||||
if (vertexAttachment.getBones() == null) {
|
|
||||||
// Unweighted vertex positions (setup pose).
|
|
||||||
zeroVertices = vertexAttachment.getVertices();
|
|
||||||
} else {
|
|
||||||
// Weighted deform offsets (zeros).
|
|
||||||
zeroVertices = zeros;
|
|
||||||
if (zeroVertices.length < vertexCount) zeros = zeroVertices = new float[vertexCount];
|
|
||||||
}
|
|
||||||
System.arraycopy(zeroVertices, 0, vertices, 0, vertexCount);
|
|
||||||
return;
|
return;
|
||||||
case current:
|
case current:
|
||||||
if (alpha == 1) break;
|
if (alpha == 1) {
|
||||||
|
verticesArray.clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
float[] vertices = verticesArray.setSize(vertexCount);
|
||||||
if (vertexAttachment.getBones() == null) {
|
if (vertexAttachment.getBones() == null) {
|
||||||
// Unweighted vertex positions.
|
// Unweighted vertex positions.
|
||||||
float[] setupVertices = vertexAttachment.getVertices();
|
float[] setupVertices = vertexAttachment.getVertices();
|
||||||
@ -960,6 +954,8 @@ public class Animation {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float[] vertices = verticesArray.setSize(vertexCount);
|
||||||
|
|
||||||
if (time >= frames[frames.length - 1]) { // Time is after last frame.
|
if (time >= frames[frames.length - 1]) { // Time is after last frame.
|
||||||
float[] lastVertices = frameVertices[frames.length - 1];
|
float[] lastVertices = frameVertices[frames.length - 1];
|
||||||
if (alpha == 1) {
|
if (alpha == 1) {
|
||||||
|
|||||||
@ -797,50 +797,43 @@ function Animation.DeformTimeline.new (frameCount)
|
|||||||
|
|
||||||
local frames = self.frames
|
local frames = self.frames
|
||||||
local verticesArray = slot.attachmentVertices
|
local verticesArray = slot.attachmentVertices
|
||||||
|
if #(verticesArray) == 0 then alpha = 1 end
|
||||||
|
|
||||||
local frameVertices = self.frameVertices
|
local frameVertices = self.frameVertices
|
||||||
local vertexCount = #(frameVertices[0])
|
local vertexCount = #(frameVertices[0])
|
||||||
local vertices = utils.setArraySize(verticesArray, vertexCount)
|
|
||||||
|
|
||||||
if time < frames[0] then
|
if time < frames[0] then
|
||||||
local vertexAttachment = slotAttachment;
|
local vertexAttachment = slotAttachment;
|
||||||
if pose == MixPose.setup then
|
if pose == MixPose.setup then
|
||||||
if (vertexAttachment.bones == nil) then
|
slot.attachmentVertices = {}
|
||||||
local i = 1
|
return;
|
||||||
local setupVertices = vertexAttachment.vertices
|
|
||||||
while i <= vertexCount do
|
|
||||||
vertices[i] = setupVertices[i]
|
|
||||||
i = i + 1
|
|
||||||
end
|
|
||||||
else
|
|
||||||
local i = 1
|
|
||||||
while i <= vertexCount do
|
|
||||||
vertices[i] = 0
|
|
||||||
i = i + 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
elseif pose == MixPose.current then
|
elseif pose == MixPose.current then
|
||||||
if (alpha ~= 1) then
|
if (alpha == 1) then
|
||||||
if (vertexAttachment.bones == nil) then
|
slot.attachmentVertices = {}
|
||||||
local setupVertices = vertexAttachment.vertices
|
return;
|
||||||
local i = 1
|
end
|
||||||
while i <= vertexCount do
|
|
||||||
vertices[i] = vertices[i] + (setupVertices[i] - vertices[i]) * alpha
|
local vertices = utils.setArraySize(verticesArray, vertexCount)
|
||||||
i = i + 1
|
if (vertexAttachment.bones == nil) then
|
||||||
end
|
local setupVertices = vertexAttachment.vertices
|
||||||
else
|
local i = 1
|
||||||
alpha = 1 - alpha
|
while i <= vertexCount do
|
||||||
local i = 1
|
vertices[i] = vertices[i] + (setupVertices[i] - vertices[i]) * alpha
|
||||||
while i <= vertexCount do
|
i = i + 1
|
||||||
vertices[i] = vertices[i] * alpha
|
end
|
||||||
i = i + 1
|
else
|
||||||
end
|
alpha = 1 - alpha
|
||||||
end
|
local i = 1
|
||||||
end
|
while i <= vertexCount do
|
||||||
|
vertices[i] = vertices[i] * alpha
|
||||||
|
i = i + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local vertices = utils.setArraySize(verticesArray, vertexCount)
|
||||||
if time >= frames[zlen(frames) - 1] then -- Time is after last frame.
|
if time >= frames[zlen(frames) - 1] then -- Time is after last frame.
|
||||||
local lastVertices = frameVertices[zlen(frames) - 1]
|
local lastVertices = frameVertices[zlen(frames) - 1]
|
||||||
if alpha == 1 then
|
if alpha == 1 then
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
604
spine-ts/build/spine-all.d.ts
vendored
604
spine-ts/build/spine-all.d.ts
vendored
@ -1,3 +1,97 @@
|
|||||||
|
declare module spine {
|
||||||
|
class AssetManager implements Disposable {
|
||||||
|
private pathPrefix;
|
||||||
|
private textureLoader;
|
||||||
|
private assets;
|
||||||
|
private errors;
|
||||||
|
private toLoad;
|
||||||
|
private loaded;
|
||||||
|
constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
|
||||||
|
loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
|
||||||
|
loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
|
||||||
|
loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
|
||||||
|
get(path: string): any;
|
||||||
|
remove(path: string): void;
|
||||||
|
removeAll(): void;
|
||||||
|
isLoadingComplete(): boolean;
|
||||||
|
getToLoad(): number;
|
||||||
|
getLoaded(): number;
|
||||||
|
dispose(): void;
|
||||||
|
hasErrors(): boolean;
|
||||||
|
getErrors(): Map<string>;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine.canvas {
|
||||||
|
class AssetManager extends spine.AssetManager {
|
||||||
|
constructor(pathPrefix?: string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
abstract class Texture {
|
||||||
|
protected _image: HTMLImageElement;
|
||||||
|
constructor(image: HTMLImageElement);
|
||||||
|
getImage(): HTMLImageElement;
|
||||||
|
abstract setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
|
||||||
|
abstract setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
|
||||||
|
abstract dispose(): void;
|
||||||
|
static filterFromString(text: string): TextureFilter;
|
||||||
|
static wrapFromString(text: string): TextureWrap;
|
||||||
|
}
|
||||||
|
enum TextureFilter {
|
||||||
|
Nearest = 9728,
|
||||||
|
Linear = 9729,
|
||||||
|
MipMap = 9987,
|
||||||
|
MipMapNearestNearest = 9984,
|
||||||
|
MipMapLinearNearest = 9985,
|
||||||
|
MipMapNearestLinear = 9986,
|
||||||
|
MipMapLinearLinear = 9987,
|
||||||
|
}
|
||||||
|
enum TextureWrap {
|
||||||
|
MirroredRepeat = 33648,
|
||||||
|
ClampToEdge = 33071,
|
||||||
|
Repeat = 10497,
|
||||||
|
}
|
||||||
|
class TextureRegion {
|
||||||
|
renderObject: any;
|
||||||
|
u: number;
|
||||||
|
v: number;
|
||||||
|
u2: number;
|
||||||
|
v2: number;
|
||||||
|
width: number;
|
||||||
|
height: number;
|
||||||
|
rotate: boolean;
|
||||||
|
offsetX: number;
|
||||||
|
offsetY: number;
|
||||||
|
originalWidth: number;
|
||||||
|
originalHeight: number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine.canvas {
|
||||||
|
class CanvasTexture extends Texture {
|
||||||
|
constructor(image: HTMLImageElement);
|
||||||
|
setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
|
||||||
|
setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
|
||||||
|
dispose(): void;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine.canvas {
|
||||||
|
class SkeletonRenderer {
|
||||||
|
static QUAD_TRIANGLES: number[];
|
||||||
|
static VERTEX_SIZE: number;
|
||||||
|
private ctx;
|
||||||
|
triangleRendering: boolean;
|
||||||
|
debugRendering: boolean;
|
||||||
|
private vertices;
|
||||||
|
private tempColor;
|
||||||
|
constructor(context: CanvasRenderingContext2D);
|
||||||
|
draw(skeleton: Skeleton): void;
|
||||||
|
private drawImages(skeleton);
|
||||||
|
private drawTriangles(skeleton);
|
||||||
|
private drawTriangle(img, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2);
|
||||||
|
private computeRegionVertices(slot, region, pma);
|
||||||
|
private computeMeshVertices(slot, mesh, pma);
|
||||||
|
}
|
||||||
|
}
|
||||||
declare module spine {
|
declare module spine {
|
||||||
class Animation {
|
class Animation {
|
||||||
name: string;
|
name: string;
|
||||||
@ -364,29 +458,6 @@ declare module spine {
|
|||||||
getMix(from: Animation, to: Animation): number;
|
getMix(from: Animation, to: Animation): number;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module spine {
|
|
||||||
class AssetManager implements Disposable {
|
|
||||||
private pathPrefix;
|
|
||||||
private textureLoader;
|
|
||||||
private assets;
|
|
||||||
private errors;
|
|
||||||
private toLoad;
|
|
||||||
private loaded;
|
|
||||||
constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
|
|
||||||
loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
|
|
||||||
loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
|
|
||||||
loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
|
|
||||||
get(path: string): any;
|
|
||||||
remove(path: string): void;
|
|
||||||
removeAll(): void;
|
|
||||||
isLoadingComplete(): boolean;
|
|
||||||
getToLoad(): number;
|
|
||||||
getLoaded(): number;
|
|
||||||
dispose(): void;
|
|
||||||
hasErrors(): boolean;
|
|
||||||
getErrors(): Map<string>;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
declare module spine {
|
||||||
class AtlasAttachmentLoader implements AttachmentLoader {
|
class AtlasAttachmentLoader implements AttachmentLoader {
|
||||||
atlas: TextureAtlas;
|
atlas: TextureAtlas;
|
||||||
@ -399,6 +470,156 @@ declare module spine {
|
|||||||
newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
|
newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
declare module spine {
|
||||||
|
abstract class Attachment {
|
||||||
|
name: string;
|
||||||
|
constructor(name: string);
|
||||||
|
}
|
||||||
|
abstract class VertexAttachment extends Attachment {
|
||||||
|
private static nextID;
|
||||||
|
id: number;
|
||||||
|
bones: Array<number>;
|
||||||
|
vertices: ArrayLike<number>;
|
||||||
|
worldVerticesLength: number;
|
||||||
|
constructor(name: string);
|
||||||
|
computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
|
||||||
|
applyDeform(sourceAttachment: VertexAttachment): boolean;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
interface AttachmentLoader {
|
||||||
|
newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
|
||||||
|
newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
|
||||||
|
newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
|
||||||
|
newPathAttachment(skin: Skin, name: string): PathAttachment;
|
||||||
|
newPointAttachment(skin: Skin, name: string): PointAttachment;
|
||||||
|
newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
enum AttachmentType {
|
||||||
|
Region = 0,
|
||||||
|
BoundingBox = 1,
|
||||||
|
Mesh = 2,
|
||||||
|
LinkedMesh = 3,
|
||||||
|
Path = 4,
|
||||||
|
Point = 5,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class BoundingBoxAttachment extends VertexAttachment {
|
||||||
|
color: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class ClippingAttachment extends VertexAttachment {
|
||||||
|
endSlot: SlotData;
|
||||||
|
color: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class MeshAttachment extends VertexAttachment {
|
||||||
|
region: TextureRegion;
|
||||||
|
path: string;
|
||||||
|
regionUVs: ArrayLike<number>;
|
||||||
|
uvs: ArrayLike<number>;
|
||||||
|
triangles: Array<number>;
|
||||||
|
color: Color;
|
||||||
|
hullLength: number;
|
||||||
|
private parentMesh;
|
||||||
|
inheritDeform: boolean;
|
||||||
|
tempColor: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
updateUVs(): void;
|
||||||
|
applyDeform(sourceAttachment: VertexAttachment): boolean;
|
||||||
|
getParentMesh(): MeshAttachment;
|
||||||
|
setParentMesh(parentMesh: MeshAttachment): void;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class PathAttachment extends VertexAttachment {
|
||||||
|
lengths: Array<number>;
|
||||||
|
closed: boolean;
|
||||||
|
constantSpeed: boolean;
|
||||||
|
color: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class PointAttachment extends VertexAttachment {
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
rotation: number;
|
||||||
|
color: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
computeWorldPosition(bone: Bone, point: Vector2): Vector2;
|
||||||
|
computeWorldRotation(bone: Bone): number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class RegionAttachment extends Attachment {
|
||||||
|
static OX1: number;
|
||||||
|
static OY1: number;
|
||||||
|
static OX2: number;
|
||||||
|
static OY2: number;
|
||||||
|
static OX3: number;
|
||||||
|
static OY3: number;
|
||||||
|
static OX4: number;
|
||||||
|
static OY4: number;
|
||||||
|
static X1: number;
|
||||||
|
static Y1: number;
|
||||||
|
static C1R: number;
|
||||||
|
static C1G: number;
|
||||||
|
static C1B: number;
|
||||||
|
static C1A: number;
|
||||||
|
static U1: number;
|
||||||
|
static V1: number;
|
||||||
|
static X2: number;
|
||||||
|
static Y2: number;
|
||||||
|
static C2R: number;
|
||||||
|
static C2G: number;
|
||||||
|
static C2B: number;
|
||||||
|
static C2A: number;
|
||||||
|
static U2: number;
|
||||||
|
static V2: number;
|
||||||
|
static X3: number;
|
||||||
|
static Y3: number;
|
||||||
|
static C3R: number;
|
||||||
|
static C3G: number;
|
||||||
|
static C3B: number;
|
||||||
|
static C3A: number;
|
||||||
|
static U3: number;
|
||||||
|
static V3: number;
|
||||||
|
static X4: number;
|
||||||
|
static Y4: number;
|
||||||
|
static C4R: number;
|
||||||
|
static C4G: number;
|
||||||
|
static C4B: number;
|
||||||
|
static C4A: number;
|
||||||
|
static U4: number;
|
||||||
|
static V4: number;
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
scaleX: number;
|
||||||
|
scaleY: number;
|
||||||
|
rotation: number;
|
||||||
|
width: number;
|
||||||
|
height: number;
|
||||||
|
color: Color;
|
||||||
|
path: string;
|
||||||
|
rendererObject: any;
|
||||||
|
region: TextureRegion;
|
||||||
|
offset: ArrayLike<number>;
|
||||||
|
uvs: ArrayLike<number>;
|
||||||
|
tempColor: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
updateOffset(): void;
|
||||||
|
setRegion(region: TextureRegion): void;
|
||||||
|
computeWorldVertices(bone: Bone, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
|
||||||
|
}
|
||||||
|
}
|
||||||
declare module spine {
|
declare module spine {
|
||||||
enum BlendMode {
|
enum BlendMode {
|
||||||
Normal = 0,
|
Normal = 0,
|
||||||
@ -787,46 +1008,6 @@ declare module spine {
|
|||||||
constructor(index: number, name: string, boneData: BoneData);
|
constructor(index: number, name: string, boneData: BoneData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module spine {
|
|
||||||
abstract class Texture {
|
|
||||||
protected _image: HTMLImageElement;
|
|
||||||
constructor(image: HTMLImageElement);
|
|
||||||
getImage(): HTMLImageElement;
|
|
||||||
abstract setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
|
|
||||||
abstract setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
|
|
||||||
abstract dispose(): void;
|
|
||||||
static filterFromString(text: string): TextureFilter;
|
|
||||||
static wrapFromString(text: string): TextureWrap;
|
|
||||||
}
|
|
||||||
enum TextureFilter {
|
|
||||||
Nearest = 9728,
|
|
||||||
Linear = 9729,
|
|
||||||
MipMap = 9987,
|
|
||||||
MipMapNearestNearest = 9984,
|
|
||||||
MipMapLinearNearest = 9985,
|
|
||||||
MipMapNearestLinear = 9986,
|
|
||||||
MipMapLinearLinear = 9987,
|
|
||||||
}
|
|
||||||
enum TextureWrap {
|
|
||||||
MirroredRepeat = 33648,
|
|
||||||
ClampToEdge = 33071,
|
|
||||||
Repeat = 10497,
|
|
||||||
}
|
|
||||||
class TextureRegion {
|
|
||||||
renderObject: any;
|
|
||||||
u: number;
|
|
||||||
v: number;
|
|
||||||
u2: number;
|
|
||||||
v2: number;
|
|
||||||
width: number;
|
|
||||||
height: number;
|
|
||||||
rotate: boolean;
|
|
||||||
offsetX: number;
|
|
||||||
offsetY: number;
|
|
||||||
originalWidth: number;
|
|
||||||
originalHeight: number;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
declare module spine {
|
||||||
class TextureAtlas implements Disposable {
|
class TextureAtlas implements Disposable {
|
||||||
pages: TextureAtlasPage[];
|
pages: TextureAtlasPage[];
|
||||||
@ -1045,156 +1226,6 @@ declare module spine {
|
|||||||
end(): void;
|
end(): void;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module spine {
|
|
||||||
abstract class Attachment {
|
|
||||||
name: string;
|
|
||||||
constructor(name: string);
|
|
||||||
}
|
|
||||||
abstract class VertexAttachment extends Attachment {
|
|
||||||
private static nextID;
|
|
||||||
id: number;
|
|
||||||
bones: Array<number>;
|
|
||||||
vertices: ArrayLike<number>;
|
|
||||||
worldVerticesLength: number;
|
|
||||||
constructor(name: string);
|
|
||||||
computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
|
|
||||||
applyDeform(sourceAttachment: VertexAttachment): boolean;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
interface AttachmentLoader {
|
|
||||||
newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
|
|
||||||
newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
|
|
||||||
newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
|
|
||||||
newPathAttachment(skin: Skin, name: string): PathAttachment;
|
|
||||||
newPointAttachment(skin: Skin, name: string): PointAttachment;
|
|
||||||
newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
enum AttachmentType {
|
|
||||||
Region = 0,
|
|
||||||
BoundingBox = 1,
|
|
||||||
Mesh = 2,
|
|
||||||
LinkedMesh = 3,
|
|
||||||
Path = 4,
|
|
||||||
Point = 5,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class BoundingBoxAttachment extends VertexAttachment {
|
|
||||||
color: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class ClippingAttachment extends VertexAttachment {
|
|
||||||
endSlot: SlotData;
|
|
||||||
color: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class MeshAttachment extends VertexAttachment {
|
|
||||||
region: TextureRegion;
|
|
||||||
path: string;
|
|
||||||
regionUVs: ArrayLike<number>;
|
|
||||||
uvs: ArrayLike<number>;
|
|
||||||
triangles: Array<number>;
|
|
||||||
color: Color;
|
|
||||||
hullLength: number;
|
|
||||||
private parentMesh;
|
|
||||||
inheritDeform: boolean;
|
|
||||||
tempColor: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
updateUVs(): void;
|
|
||||||
applyDeform(sourceAttachment: VertexAttachment): boolean;
|
|
||||||
getParentMesh(): MeshAttachment;
|
|
||||||
setParentMesh(parentMesh: MeshAttachment): void;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class PathAttachment extends VertexAttachment {
|
|
||||||
lengths: Array<number>;
|
|
||||||
closed: boolean;
|
|
||||||
constantSpeed: boolean;
|
|
||||||
color: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class PointAttachment extends VertexAttachment {
|
|
||||||
x: number;
|
|
||||||
y: number;
|
|
||||||
rotation: number;
|
|
||||||
color: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
computeWorldPosition(bone: Bone, point: Vector2): Vector2;
|
|
||||||
computeWorldRotation(bone: Bone): number;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class RegionAttachment extends Attachment {
|
|
||||||
static OX1: number;
|
|
||||||
static OY1: number;
|
|
||||||
static OX2: number;
|
|
||||||
static OY2: number;
|
|
||||||
static OX3: number;
|
|
||||||
static OY3: number;
|
|
||||||
static OX4: number;
|
|
||||||
static OY4: number;
|
|
||||||
static X1: number;
|
|
||||||
static Y1: number;
|
|
||||||
static C1R: number;
|
|
||||||
static C1G: number;
|
|
||||||
static C1B: number;
|
|
||||||
static C1A: number;
|
|
||||||
static U1: number;
|
|
||||||
static V1: number;
|
|
||||||
static X2: number;
|
|
||||||
static Y2: number;
|
|
||||||
static C2R: number;
|
|
||||||
static C2G: number;
|
|
||||||
static C2B: number;
|
|
||||||
static C2A: number;
|
|
||||||
static U2: number;
|
|
||||||
static V2: number;
|
|
||||||
static X3: number;
|
|
||||||
static Y3: number;
|
|
||||||
static C3R: number;
|
|
||||||
static C3G: number;
|
|
||||||
static C3B: number;
|
|
||||||
static C3A: number;
|
|
||||||
static U3: number;
|
|
||||||
static V3: number;
|
|
||||||
static X4: number;
|
|
||||||
static Y4: number;
|
|
||||||
static C4R: number;
|
|
||||||
static C4G: number;
|
|
||||||
static C4B: number;
|
|
||||||
static C4A: number;
|
|
||||||
static U4: number;
|
|
||||||
static V4: number;
|
|
||||||
x: number;
|
|
||||||
y: number;
|
|
||||||
scaleX: number;
|
|
||||||
scaleY: number;
|
|
||||||
rotation: number;
|
|
||||||
width: number;
|
|
||||||
height: number;
|
|
||||||
color: Color;
|
|
||||||
path: string;
|
|
||||||
rendererObject: any;
|
|
||||||
region: TextureRegion;
|
|
||||||
offset: ArrayLike<number>;
|
|
||||||
uvs: ArrayLike<number>;
|
|
||||||
tempColor: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
updateOffset(): void;
|
|
||||||
setRegion(region: TextureRegion): void;
|
|
||||||
computeWorldVertices(bone: Bone, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
declare module spine {
|
||||||
class JitterEffect implements VertexEffect {
|
class JitterEffect implements VertexEffect {
|
||||||
jitterX: number;
|
jitterX: number;
|
||||||
@ -1220,35 +1251,56 @@ declare module spine {
|
|||||||
end(): void;
|
end(): void;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module spine.canvas {
|
declare module spine.threejs {
|
||||||
class AssetManager extends spine.AssetManager {
|
class AssetManager extends spine.AssetManager {
|
||||||
constructor(pathPrefix?: string);
|
constructor(pathPrefix?: string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module spine.canvas {
|
declare module spine.threejs {
|
||||||
class CanvasTexture extends Texture {
|
class MeshBatcher {
|
||||||
|
mesh: THREE.Mesh;
|
||||||
|
private static VERTEX_SIZE;
|
||||||
|
private vertexBuffer;
|
||||||
|
private vertices;
|
||||||
|
private verticesLength;
|
||||||
|
private indices;
|
||||||
|
private indicesLength;
|
||||||
|
constructor(mesh: THREE.Mesh, maxVertices?: number);
|
||||||
|
begin(): void;
|
||||||
|
batch(vertices: ArrayLike<number>, verticesLength: number, indices: ArrayLike<number>, indicesLength: number, z?: number): void;
|
||||||
|
end(): void;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine.threejs {
|
||||||
|
class SkeletonMesh extends THREE.Mesh {
|
||||||
|
tempPos: Vector2;
|
||||||
|
tempUv: Vector2;
|
||||||
|
tempLight: Color;
|
||||||
|
tempDark: Color;
|
||||||
|
skeleton: Skeleton;
|
||||||
|
state: AnimationState;
|
||||||
|
zOffset: number;
|
||||||
|
vertexEffect: VertexEffect;
|
||||||
|
private batcher;
|
||||||
|
private clipper;
|
||||||
|
static QUAD_TRIANGLES: number[];
|
||||||
|
static VERTEX_SIZE: number;
|
||||||
|
private vertices;
|
||||||
|
private tempColor;
|
||||||
|
constructor(skeletonData: SkeletonData);
|
||||||
|
update(deltaTime: number): void;
|
||||||
|
private updateGeometry();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine.threejs {
|
||||||
|
class ThreeJsTexture extends Texture {
|
||||||
|
texture: THREE.Texture;
|
||||||
constructor(image: HTMLImageElement);
|
constructor(image: HTMLImageElement);
|
||||||
setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
|
setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
|
||||||
setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
|
setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
|
||||||
dispose(): void;
|
dispose(): void;
|
||||||
}
|
static toThreeJsTextureFilter(filter: TextureFilter): THREE.TextureFilter;
|
||||||
}
|
static toThreeJsTextureWrap(wrap: TextureWrap): THREE.Wrapping;
|
||||||
declare module spine.canvas {
|
|
||||||
class SkeletonRenderer {
|
|
||||||
static QUAD_TRIANGLES: number[];
|
|
||||||
static VERTEX_SIZE: number;
|
|
||||||
private ctx;
|
|
||||||
triangleRendering: boolean;
|
|
||||||
debugRendering: boolean;
|
|
||||||
private vertices;
|
|
||||||
private tempColor;
|
|
||||||
constructor(context: CanvasRenderingContext2D);
|
|
||||||
draw(skeleton: Skeleton): void;
|
|
||||||
private drawImages(skeleton);
|
|
||||||
private drawTriangles(skeleton);
|
|
||||||
private drawTriangle(img, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2);
|
|
||||||
private computeRegionVertices(slot, region, pma);
|
|
||||||
private computeMeshVertices(slot, mesh, pma);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module spine.webgl {
|
declare module spine.webgl {
|
||||||
@ -1342,22 +1394,22 @@ declare module spine.webgl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module spine.webgl {
|
declare module spine.webgl {
|
||||||
const M00 = 0;
|
const M00: number;
|
||||||
const M01 = 4;
|
const M01: number;
|
||||||
const M02 = 8;
|
const M02: number;
|
||||||
const M03 = 12;
|
const M03: number;
|
||||||
const M10 = 1;
|
const M10: number;
|
||||||
const M11 = 5;
|
const M11: number;
|
||||||
const M12 = 9;
|
const M12: number;
|
||||||
const M13 = 13;
|
const M13: number;
|
||||||
const M20 = 2;
|
const M20: number;
|
||||||
const M21 = 6;
|
const M21: number;
|
||||||
const M22 = 10;
|
const M22: number;
|
||||||
const M23 = 14;
|
const M23: number;
|
||||||
const M30 = 3;
|
const M30: number;
|
||||||
const M31 = 7;
|
const M31: number;
|
||||||
const M32 = 11;
|
const M32: number;
|
||||||
const M33 = 15;
|
const M33: number;
|
||||||
class Matrix4 {
|
class Matrix4 {
|
||||||
temp: Float32Array;
|
temp: Float32Array;
|
||||||
values: Float32Array;
|
values: Float32Array;
|
||||||
@ -1685,58 +1737,6 @@ declare module spine.webgl {
|
|||||||
static getSourceGLBlendMode(blendMode: BlendMode, premultipliedAlpha?: boolean): number;
|
static getSourceGLBlendMode(blendMode: BlendMode, premultipliedAlpha?: boolean): number;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module spine.threejs {
|
|
||||||
class AssetManager extends spine.AssetManager {
|
|
||||||
constructor(pathPrefix?: string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine.threejs {
|
|
||||||
class MeshBatcher {
|
|
||||||
mesh: THREE.Mesh;
|
|
||||||
private static VERTEX_SIZE;
|
|
||||||
private vertexBuffer;
|
|
||||||
private vertices;
|
|
||||||
private verticesLength;
|
|
||||||
private indices;
|
|
||||||
private indicesLength;
|
|
||||||
constructor(mesh: THREE.Mesh, maxVertices?: number);
|
|
||||||
begin(): void;
|
|
||||||
batch(vertices: ArrayLike<number>, verticesLength: number, indices: ArrayLike<number>, indicesLength: number, z?: number): void;
|
|
||||||
end(): void;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine.threejs {
|
|
||||||
class SkeletonMesh extends THREE.Mesh {
|
|
||||||
tempPos: Vector2;
|
|
||||||
tempUv: Vector2;
|
|
||||||
tempLight: Color;
|
|
||||||
tempDark: Color;
|
|
||||||
skeleton: Skeleton;
|
|
||||||
state: AnimationState;
|
|
||||||
zOffset: number;
|
|
||||||
vertexEffect: VertexEffect;
|
|
||||||
private batcher;
|
|
||||||
private clipper;
|
|
||||||
static QUAD_TRIANGLES: number[];
|
|
||||||
static VERTEX_SIZE: number;
|
|
||||||
private vertices;
|
|
||||||
private tempColor;
|
|
||||||
constructor(skeletonData: SkeletonData);
|
|
||||||
update(deltaTime: number): void;
|
|
||||||
private updateGeometry();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine.threejs {
|
|
||||||
class ThreeJsTexture extends Texture {
|
|
||||||
texture: THREE.Texture;
|
|
||||||
constructor(image: HTMLImageElement);
|
|
||||||
setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
|
|
||||||
setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
|
|
||||||
dispose(): void;
|
|
||||||
static toThreeJsTextureFilter(filter: TextureFilter): THREE.TextureFilter;
|
|
||||||
static toThreeJsTextureWrap(wrap: TextureWrap): THREE.Wrapping;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
declare module spine {
|
||||||
class SpineWidget {
|
class SpineWidget {
|
||||||
skeleton: Skeleton;
|
skeleton: Skeleton;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
488
spine-ts/build/spine-canvas.d.ts
vendored
488
spine-ts/build/spine-canvas.d.ts
vendored
@ -1,3 +1,97 @@
|
|||||||
|
declare module spine {
|
||||||
|
class AssetManager implements Disposable {
|
||||||
|
private pathPrefix;
|
||||||
|
private textureLoader;
|
||||||
|
private assets;
|
||||||
|
private errors;
|
||||||
|
private toLoad;
|
||||||
|
private loaded;
|
||||||
|
constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
|
||||||
|
loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
|
||||||
|
loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
|
||||||
|
loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
|
||||||
|
get(path: string): any;
|
||||||
|
remove(path: string): void;
|
||||||
|
removeAll(): void;
|
||||||
|
isLoadingComplete(): boolean;
|
||||||
|
getToLoad(): number;
|
||||||
|
getLoaded(): number;
|
||||||
|
dispose(): void;
|
||||||
|
hasErrors(): boolean;
|
||||||
|
getErrors(): Map<string>;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine.canvas {
|
||||||
|
class AssetManager extends spine.AssetManager {
|
||||||
|
constructor(pathPrefix?: string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
abstract class Texture {
|
||||||
|
protected _image: HTMLImageElement;
|
||||||
|
constructor(image: HTMLImageElement);
|
||||||
|
getImage(): HTMLImageElement;
|
||||||
|
abstract setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
|
||||||
|
abstract setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
|
||||||
|
abstract dispose(): void;
|
||||||
|
static filterFromString(text: string): TextureFilter;
|
||||||
|
static wrapFromString(text: string): TextureWrap;
|
||||||
|
}
|
||||||
|
enum TextureFilter {
|
||||||
|
Nearest = 9728,
|
||||||
|
Linear = 9729,
|
||||||
|
MipMap = 9987,
|
||||||
|
MipMapNearestNearest = 9984,
|
||||||
|
MipMapLinearNearest = 9985,
|
||||||
|
MipMapNearestLinear = 9986,
|
||||||
|
MipMapLinearLinear = 9987,
|
||||||
|
}
|
||||||
|
enum TextureWrap {
|
||||||
|
MirroredRepeat = 33648,
|
||||||
|
ClampToEdge = 33071,
|
||||||
|
Repeat = 10497,
|
||||||
|
}
|
||||||
|
class TextureRegion {
|
||||||
|
renderObject: any;
|
||||||
|
u: number;
|
||||||
|
v: number;
|
||||||
|
u2: number;
|
||||||
|
v2: number;
|
||||||
|
width: number;
|
||||||
|
height: number;
|
||||||
|
rotate: boolean;
|
||||||
|
offsetX: number;
|
||||||
|
offsetY: number;
|
||||||
|
originalWidth: number;
|
||||||
|
originalHeight: number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine.canvas {
|
||||||
|
class CanvasTexture extends Texture {
|
||||||
|
constructor(image: HTMLImageElement);
|
||||||
|
setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
|
||||||
|
setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
|
||||||
|
dispose(): void;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine.canvas {
|
||||||
|
class SkeletonRenderer {
|
||||||
|
static QUAD_TRIANGLES: number[];
|
||||||
|
static VERTEX_SIZE: number;
|
||||||
|
private ctx;
|
||||||
|
triangleRendering: boolean;
|
||||||
|
debugRendering: boolean;
|
||||||
|
private vertices;
|
||||||
|
private tempColor;
|
||||||
|
constructor(context: CanvasRenderingContext2D);
|
||||||
|
draw(skeleton: Skeleton): void;
|
||||||
|
private drawImages(skeleton);
|
||||||
|
private drawTriangles(skeleton);
|
||||||
|
private drawTriangle(img, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2);
|
||||||
|
private computeRegionVertices(slot, region, pma);
|
||||||
|
private computeMeshVertices(slot, mesh, pma);
|
||||||
|
}
|
||||||
|
}
|
||||||
declare module spine {
|
declare module spine {
|
||||||
class Animation {
|
class Animation {
|
||||||
name: string;
|
name: string;
|
||||||
@ -364,29 +458,6 @@ declare module spine {
|
|||||||
getMix(from: Animation, to: Animation): number;
|
getMix(from: Animation, to: Animation): number;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module spine {
|
|
||||||
class AssetManager implements Disposable {
|
|
||||||
private pathPrefix;
|
|
||||||
private textureLoader;
|
|
||||||
private assets;
|
|
||||||
private errors;
|
|
||||||
private toLoad;
|
|
||||||
private loaded;
|
|
||||||
constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
|
|
||||||
loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
|
|
||||||
loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
|
|
||||||
loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
|
|
||||||
get(path: string): any;
|
|
||||||
remove(path: string): void;
|
|
||||||
removeAll(): void;
|
|
||||||
isLoadingComplete(): boolean;
|
|
||||||
getToLoad(): number;
|
|
||||||
getLoaded(): number;
|
|
||||||
dispose(): void;
|
|
||||||
hasErrors(): boolean;
|
|
||||||
getErrors(): Map<string>;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
declare module spine {
|
||||||
class AtlasAttachmentLoader implements AttachmentLoader {
|
class AtlasAttachmentLoader implements AttachmentLoader {
|
||||||
atlas: TextureAtlas;
|
atlas: TextureAtlas;
|
||||||
@ -399,6 +470,156 @@ declare module spine {
|
|||||||
newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
|
newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
declare module spine {
|
||||||
|
abstract class Attachment {
|
||||||
|
name: string;
|
||||||
|
constructor(name: string);
|
||||||
|
}
|
||||||
|
abstract class VertexAttachment extends Attachment {
|
||||||
|
private static nextID;
|
||||||
|
id: number;
|
||||||
|
bones: Array<number>;
|
||||||
|
vertices: ArrayLike<number>;
|
||||||
|
worldVerticesLength: number;
|
||||||
|
constructor(name: string);
|
||||||
|
computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
|
||||||
|
applyDeform(sourceAttachment: VertexAttachment): boolean;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
interface AttachmentLoader {
|
||||||
|
newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
|
||||||
|
newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
|
||||||
|
newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
|
||||||
|
newPathAttachment(skin: Skin, name: string): PathAttachment;
|
||||||
|
newPointAttachment(skin: Skin, name: string): PointAttachment;
|
||||||
|
newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
enum AttachmentType {
|
||||||
|
Region = 0,
|
||||||
|
BoundingBox = 1,
|
||||||
|
Mesh = 2,
|
||||||
|
LinkedMesh = 3,
|
||||||
|
Path = 4,
|
||||||
|
Point = 5,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class BoundingBoxAttachment extends VertexAttachment {
|
||||||
|
color: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class ClippingAttachment extends VertexAttachment {
|
||||||
|
endSlot: SlotData;
|
||||||
|
color: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class MeshAttachment extends VertexAttachment {
|
||||||
|
region: TextureRegion;
|
||||||
|
path: string;
|
||||||
|
regionUVs: ArrayLike<number>;
|
||||||
|
uvs: ArrayLike<number>;
|
||||||
|
triangles: Array<number>;
|
||||||
|
color: Color;
|
||||||
|
hullLength: number;
|
||||||
|
private parentMesh;
|
||||||
|
inheritDeform: boolean;
|
||||||
|
tempColor: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
updateUVs(): void;
|
||||||
|
applyDeform(sourceAttachment: VertexAttachment): boolean;
|
||||||
|
getParentMesh(): MeshAttachment;
|
||||||
|
setParentMesh(parentMesh: MeshAttachment): void;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class PathAttachment extends VertexAttachment {
|
||||||
|
lengths: Array<number>;
|
||||||
|
closed: boolean;
|
||||||
|
constantSpeed: boolean;
|
||||||
|
color: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class PointAttachment extends VertexAttachment {
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
rotation: number;
|
||||||
|
color: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
computeWorldPosition(bone: Bone, point: Vector2): Vector2;
|
||||||
|
computeWorldRotation(bone: Bone): number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class RegionAttachment extends Attachment {
|
||||||
|
static OX1: number;
|
||||||
|
static OY1: number;
|
||||||
|
static OX2: number;
|
||||||
|
static OY2: number;
|
||||||
|
static OX3: number;
|
||||||
|
static OY3: number;
|
||||||
|
static OX4: number;
|
||||||
|
static OY4: number;
|
||||||
|
static X1: number;
|
||||||
|
static Y1: number;
|
||||||
|
static C1R: number;
|
||||||
|
static C1G: number;
|
||||||
|
static C1B: number;
|
||||||
|
static C1A: number;
|
||||||
|
static U1: number;
|
||||||
|
static V1: number;
|
||||||
|
static X2: number;
|
||||||
|
static Y2: number;
|
||||||
|
static C2R: number;
|
||||||
|
static C2G: number;
|
||||||
|
static C2B: number;
|
||||||
|
static C2A: number;
|
||||||
|
static U2: number;
|
||||||
|
static V2: number;
|
||||||
|
static X3: number;
|
||||||
|
static Y3: number;
|
||||||
|
static C3R: number;
|
||||||
|
static C3G: number;
|
||||||
|
static C3B: number;
|
||||||
|
static C3A: number;
|
||||||
|
static U3: number;
|
||||||
|
static V3: number;
|
||||||
|
static X4: number;
|
||||||
|
static Y4: number;
|
||||||
|
static C4R: number;
|
||||||
|
static C4G: number;
|
||||||
|
static C4B: number;
|
||||||
|
static C4A: number;
|
||||||
|
static U4: number;
|
||||||
|
static V4: number;
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
scaleX: number;
|
||||||
|
scaleY: number;
|
||||||
|
rotation: number;
|
||||||
|
width: number;
|
||||||
|
height: number;
|
||||||
|
color: Color;
|
||||||
|
path: string;
|
||||||
|
rendererObject: any;
|
||||||
|
region: TextureRegion;
|
||||||
|
offset: ArrayLike<number>;
|
||||||
|
uvs: ArrayLike<number>;
|
||||||
|
tempColor: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
updateOffset(): void;
|
||||||
|
setRegion(region: TextureRegion): void;
|
||||||
|
computeWorldVertices(bone: Bone, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
|
||||||
|
}
|
||||||
|
}
|
||||||
declare module spine {
|
declare module spine {
|
||||||
enum BlendMode {
|
enum BlendMode {
|
||||||
Normal = 0,
|
Normal = 0,
|
||||||
@ -787,46 +1008,6 @@ declare module spine {
|
|||||||
constructor(index: number, name: string, boneData: BoneData);
|
constructor(index: number, name: string, boneData: BoneData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module spine {
|
|
||||||
abstract class Texture {
|
|
||||||
protected _image: HTMLImageElement;
|
|
||||||
constructor(image: HTMLImageElement);
|
|
||||||
getImage(): HTMLImageElement;
|
|
||||||
abstract setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
|
|
||||||
abstract setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
|
|
||||||
abstract dispose(): void;
|
|
||||||
static filterFromString(text: string): TextureFilter;
|
|
||||||
static wrapFromString(text: string): TextureWrap;
|
|
||||||
}
|
|
||||||
enum TextureFilter {
|
|
||||||
Nearest = 9728,
|
|
||||||
Linear = 9729,
|
|
||||||
MipMap = 9987,
|
|
||||||
MipMapNearestNearest = 9984,
|
|
||||||
MipMapLinearNearest = 9985,
|
|
||||||
MipMapNearestLinear = 9986,
|
|
||||||
MipMapLinearLinear = 9987,
|
|
||||||
}
|
|
||||||
enum TextureWrap {
|
|
||||||
MirroredRepeat = 33648,
|
|
||||||
ClampToEdge = 33071,
|
|
||||||
Repeat = 10497,
|
|
||||||
}
|
|
||||||
class TextureRegion {
|
|
||||||
renderObject: any;
|
|
||||||
u: number;
|
|
||||||
v: number;
|
|
||||||
u2: number;
|
|
||||||
v2: number;
|
|
||||||
width: number;
|
|
||||||
height: number;
|
|
||||||
rotate: boolean;
|
|
||||||
offsetX: number;
|
|
||||||
offsetY: number;
|
|
||||||
originalWidth: number;
|
|
||||||
originalHeight: number;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
declare module spine {
|
||||||
class TextureAtlas implements Disposable {
|
class TextureAtlas implements Disposable {
|
||||||
pages: TextureAtlasPage[];
|
pages: TextureAtlasPage[];
|
||||||
@ -1045,156 +1226,6 @@ declare module spine {
|
|||||||
end(): void;
|
end(): void;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module spine {
|
|
||||||
abstract class Attachment {
|
|
||||||
name: string;
|
|
||||||
constructor(name: string);
|
|
||||||
}
|
|
||||||
abstract class VertexAttachment extends Attachment {
|
|
||||||
private static nextID;
|
|
||||||
id: number;
|
|
||||||
bones: Array<number>;
|
|
||||||
vertices: ArrayLike<number>;
|
|
||||||
worldVerticesLength: number;
|
|
||||||
constructor(name: string);
|
|
||||||
computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
|
|
||||||
applyDeform(sourceAttachment: VertexAttachment): boolean;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
interface AttachmentLoader {
|
|
||||||
newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
|
|
||||||
newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
|
|
||||||
newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
|
|
||||||
newPathAttachment(skin: Skin, name: string): PathAttachment;
|
|
||||||
newPointAttachment(skin: Skin, name: string): PointAttachment;
|
|
||||||
newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
enum AttachmentType {
|
|
||||||
Region = 0,
|
|
||||||
BoundingBox = 1,
|
|
||||||
Mesh = 2,
|
|
||||||
LinkedMesh = 3,
|
|
||||||
Path = 4,
|
|
||||||
Point = 5,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class BoundingBoxAttachment extends VertexAttachment {
|
|
||||||
color: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class ClippingAttachment extends VertexAttachment {
|
|
||||||
endSlot: SlotData;
|
|
||||||
color: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class MeshAttachment extends VertexAttachment {
|
|
||||||
region: TextureRegion;
|
|
||||||
path: string;
|
|
||||||
regionUVs: ArrayLike<number>;
|
|
||||||
uvs: ArrayLike<number>;
|
|
||||||
triangles: Array<number>;
|
|
||||||
color: Color;
|
|
||||||
hullLength: number;
|
|
||||||
private parentMesh;
|
|
||||||
inheritDeform: boolean;
|
|
||||||
tempColor: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
updateUVs(): void;
|
|
||||||
applyDeform(sourceAttachment: VertexAttachment): boolean;
|
|
||||||
getParentMesh(): MeshAttachment;
|
|
||||||
setParentMesh(parentMesh: MeshAttachment): void;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class PathAttachment extends VertexAttachment {
|
|
||||||
lengths: Array<number>;
|
|
||||||
closed: boolean;
|
|
||||||
constantSpeed: boolean;
|
|
||||||
color: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class PointAttachment extends VertexAttachment {
|
|
||||||
x: number;
|
|
||||||
y: number;
|
|
||||||
rotation: number;
|
|
||||||
color: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
computeWorldPosition(bone: Bone, point: Vector2): Vector2;
|
|
||||||
computeWorldRotation(bone: Bone): number;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class RegionAttachment extends Attachment {
|
|
||||||
static OX1: number;
|
|
||||||
static OY1: number;
|
|
||||||
static OX2: number;
|
|
||||||
static OY2: number;
|
|
||||||
static OX3: number;
|
|
||||||
static OY3: number;
|
|
||||||
static OX4: number;
|
|
||||||
static OY4: number;
|
|
||||||
static X1: number;
|
|
||||||
static Y1: number;
|
|
||||||
static C1R: number;
|
|
||||||
static C1G: number;
|
|
||||||
static C1B: number;
|
|
||||||
static C1A: number;
|
|
||||||
static U1: number;
|
|
||||||
static V1: number;
|
|
||||||
static X2: number;
|
|
||||||
static Y2: number;
|
|
||||||
static C2R: number;
|
|
||||||
static C2G: number;
|
|
||||||
static C2B: number;
|
|
||||||
static C2A: number;
|
|
||||||
static U2: number;
|
|
||||||
static V2: number;
|
|
||||||
static X3: number;
|
|
||||||
static Y3: number;
|
|
||||||
static C3R: number;
|
|
||||||
static C3G: number;
|
|
||||||
static C3B: number;
|
|
||||||
static C3A: number;
|
|
||||||
static U3: number;
|
|
||||||
static V3: number;
|
|
||||||
static X4: number;
|
|
||||||
static Y4: number;
|
|
||||||
static C4R: number;
|
|
||||||
static C4G: number;
|
|
||||||
static C4B: number;
|
|
||||||
static C4A: number;
|
|
||||||
static U4: number;
|
|
||||||
static V4: number;
|
|
||||||
x: number;
|
|
||||||
y: number;
|
|
||||||
scaleX: number;
|
|
||||||
scaleY: number;
|
|
||||||
rotation: number;
|
|
||||||
width: number;
|
|
||||||
height: number;
|
|
||||||
color: Color;
|
|
||||||
path: string;
|
|
||||||
rendererObject: any;
|
|
||||||
region: TextureRegion;
|
|
||||||
offset: ArrayLike<number>;
|
|
||||||
uvs: ArrayLike<number>;
|
|
||||||
tempColor: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
updateOffset(): void;
|
|
||||||
setRegion(region: TextureRegion): void;
|
|
||||||
computeWorldVertices(bone: Bone, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
declare module spine {
|
||||||
class JitterEffect implements VertexEffect {
|
class JitterEffect implements VertexEffect {
|
||||||
jitterX: number;
|
jitterX: number;
|
||||||
@ -1220,34 +1251,3 @@ declare module spine {
|
|||||||
end(): void;
|
end(): void;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module spine.canvas {
|
|
||||||
class AssetManager extends spine.AssetManager {
|
|
||||||
constructor(pathPrefix?: string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine.canvas {
|
|
||||||
class CanvasTexture extends Texture {
|
|
||||||
constructor(image: HTMLImageElement);
|
|
||||||
setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
|
|
||||||
setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
|
|
||||||
dispose(): void;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine.canvas {
|
|
||||||
class SkeletonRenderer {
|
|
||||||
static QUAD_TRIANGLES: number[];
|
|
||||||
static VERTEX_SIZE: number;
|
|
||||||
private ctx;
|
|
||||||
triangleRendering: boolean;
|
|
||||||
debugRendering: boolean;
|
|
||||||
private vertices;
|
|
||||||
private tempColor;
|
|
||||||
constructor(context: CanvasRenderingContext2D);
|
|
||||||
draw(skeleton: Skeleton): void;
|
|
||||||
private drawImages(skeleton);
|
|
||||||
private drawTriangles(skeleton);
|
|
||||||
private drawTriangle(img, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2);
|
|
||||||
private computeRegionVertices(slot, region, pma);
|
|
||||||
private computeMeshVertices(slot, mesh, pma);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
300
spine-ts/build/spine-core.d.ts
vendored
300
spine-ts/build/spine-core.d.ts
vendored
@ -399,6 +399,156 @@ declare module spine {
|
|||||||
newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
|
newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
declare module spine {
|
||||||
|
abstract class Attachment {
|
||||||
|
name: string;
|
||||||
|
constructor(name: string);
|
||||||
|
}
|
||||||
|
abstract class VertexAttachment extends Attachment {
|
||||||
|
private static nextID;
|
||||||
|
id: number;
|
||||||
|
bones: Array<number>;
|
||||||
|
vertices: ArrayLike<number>;
|
||||||
|
worldVerticesLength: number;
|
||||||
|
constructor(name: string);
|
||||||
|
computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
|
||||||
|
applyDeform(sourceAttachment: VertexAttachment): boolean;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
interface AttachmentLoader {
|
||||||
|
newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
|
||||||
|
newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
|
||||||
|
newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
|
||||||
|
newPathAttachment(skin: Skin, name: string): PathAttachment;
|
||||||
|
newPointAttachment(skin: Skin, name: string): PointAttachment;
|
||||||
|
newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
enum AttachmentType {
|
||||||
|
Region = 0,
|
||||||
|
BoundingBox = 1,
|
||||||
|
Mesh = 2,
|
||||||
|
LinkedMesh = 3,
|
||||||
|
Path = 4,
|
||||||
|
Point = 5,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class BoundingBoxAttachment extends VertexAttachment {
|
||||||
|
color: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class ClippingAttachment extends VertexAttachment {
|
||||||
|
endSlot: SlotData;
|
||||||
|
color: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class MeshAttachment extends VertexAttachment {
|
||||||
|
region: TextureRegion;
|
||||||
|
path: string;
|
||||||
|
regionUVs: ArrayLike<number>;
|
||||||
|
uvs: ArrayLike<number>;
|
||||||
|
triangles: Array<number>;
|
||||||
|
color: Color;
|
||||||
|
hullLength: number;
|
||||||
|
private parentMesh;
|
||||||
|
inheritDeform: boolean;
|
||||||
|
tempColor: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
updateUVs(): void;
|
||||||
|
applyDeform(sourceAttachment: VertexAttachment): boolean;
|
||||||
|
getParentMesh(): MeshAttachment;
|
||||||
|
setParentMesh(parentMesh: MeshAttachment): void;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class PathAttachment extends VertexAttachment {
|
||||||
|
lengths: Array<number>;
|
||||||
|
closed: boolean;
|
||||||
|
constantSpeed: boolean;
|
||||||
|
color: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class PointAttachment extends VertexAttachment {
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
rotation: number;
|
||||||
|
color: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
computeWorldPosition(bone: Bone, point: Vector2): Vector2;
|
||||||
|
computeWorldRotation(bone: Bone): number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class RegionAttachment extends Attachment {
|
||||||
|
static OX1: number;
|
||||||
|
static OY1: number;
|
||||||
|
static OX2: number;
|
||||||
|
static OY2: number;
|
||||||
|
static OX3: number;
|
||||||
|
static OY3: number;
|
||||||
|
static OX4: number;
|
||||||
|
static OY4: number;
|
||||||
|
static X1: number;
|
||||||
|
static Y1: number;
|
||||||
|
static C1R: number;
|
||||||
|
static C1G: number;
|
||||||
|
static C1B: number;
|
||||||
|
static C1A: number;
|
||||||
|
static U1: number;
|
||||||
|
static V1: number;
|
||||||
|
static X2: number;
|
||||||
|
static Y2: number;
|
||||||
|
static C2R: number;
|
||||||
|
static C2G: number;
|
||||||
|
static C2B: number;
|
||||||
|
static C2A: number;
|
||||||
|
static U2: number;
|
||||||
|
static V2: number;
|
||||||
|
static X3: number;
|
||||||
|
static Y3: number;
|
||||||
|
static C3R: number;
|
||||||
|
static C3G: number;
|
||||||
|
static C3B: number;
|
||||||
|
static C3A: number;
|
||||||
|
static U3: number;
|
||||||
|
static V3: number;
|
||||||
|
static X4: number;
|
||||||
|
static Y4: number;
|
||||||
|
static C4R: number;
|
||||||
|
static C4G: number;
|
||||||
|
static C4B: number;
|
||||||
|
static C4A: number;
|
||||||
|
static U4: number;
|
||||||
|
static V4: number;
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
scaleX: number;
|
||||||
|
scaleY: number;
|
||||||
|
rotation: number;
|
||||||
|
width: number;
|
||||||
|
height: number;
|
||||||
|
color: Color;
|
||||||
|
path: string;
|
||||||
|
rendererObject: any;
|
||||||
|
region: TextureRegion;
|
||||||
|
offset: ArrayLike<number>;
|
||||||
|
uvs: ArrayLike<number>;
|
||||||
|
tempColor: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
updateOffset(): void;
|
||||||
|
setRegion(region: TextureRegion): void;
|
||||||
|
computeWorldVertices(bone: Bone, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
|
||||||
|
}
|
||||||
|
}
|
||||||
declare module spine {
|
declare module spine {
|
||||||
enum BlendMode {
|
enum BlendMode {
|
||||||
Normal = 0,
|
Normal = 0,
|
||||||
@ -1045,156 +1195,6 @@ declare module spine {
|
|||||||
end(): void;
|
end(): void;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module spine {
|
|
||||||
abstract class Attachment {
|
|
||||||
name: string;
|
|
||||||
constructor(name: string);
|
|
||||||
}
|
|
||||||
abstract class VertexAttachment extends Attachment {
|
|
||||||
private static nextID;
|
|
||||||
id: number;
|
|
||||||
bones: Array<number>;
|
|
||||||
vertices: ArrayLike<number>;
|
|
||||||
worldVerticesLength: number;
|
|
||||||
constructor(name: string);
|
|
||||||
computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
|
|
||||||
applyDeform(sourceAttachment: VertexAttachment): boolean;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
interface AttachmentLoader {
|
|
||||||
newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
|
|
||||||
newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
|
|
||||||
newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
|
|
||||||
newPathAttachment(skin: Skin, name: string): PathAttachment;
|
|
||||||
newPointAttachment(skin: Skin, name: string): PointAttachment;
|
|
||||||
newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
enum AttachmentType {
|
|
||||||
Region = 0,
|
|
||||||
BoundingBox = 1,
|
|
||||||
Mesh = 2,
|
|
||||||
LinkedMesh = 3,
|
|
||||||
Path = 4,
|
|
||||||
Point = 5,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class BoundingBoxAttachment extends VertexAttachment {
|
|
||||||
color: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class ClippingAttachment extends VertexAttachment {
|
|
||||||
endSlot: SlotData;
|
|
||||||
color: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class MeshAttachment extends VertexAttachment {
|
|
||||||
region: TextureRegion;
|
|
||||||
path: string;
|
|
||||||
regionUVs: ArrayLike<number>;
|
|
||||||
uvs: ArrayLike<number>;
|
|
||||||
triangles: Array<number>;
|
|
||||||
color: Color;
|
|
||||||
hullLength: number;
|
|
||||||
private parentMesh;
|
|
||||||
inheritDeform: boolean;
|
|
||||||
tempColor: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
updateUVs(): void;
|
|
||||||
applyDeform(sourceAttachment: VertexAttachment): boolean;
|
|
||||||
getParentMesh(): MeshAttachment;
|
|
||||||
setParentMesh(parentMesh: MeshAttachment): void;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class PathAttachment extends VertexAttachment {
|
|
||||||
lengths: Array<number>;
|
|
||||||
closed: boolean;
|
|
||||||
constantSpeed: boolean;
|
|
||||||
color: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class PointAttachment extends VertexAttachment {
|
|
||||||
x: number;
|
|
||||||
y: number;
|
|
||||||
rotation: number;
|
|
||||||
color: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
computeWorldPosition(bone: Bone, point: Vector2): Vector2;
|
|
||||||
computeWorldRotation(bone: Bone): number;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class RegionAttachment extends Attachment {
|
|
||||||
static OX1: number;
|
|
||||||
static OY1: number;
|
|
||||||
static OX2: number;
|
|
||||||
static OY2: number;
|
|
||||||
static OX3: number;
|
|
||||||
static OY3: number;
|
|
||||||
static OX4: number;
|
|
||||||
static OY4: number;
|
|
||||||
static X1: number;
|
|
||||||
static Y1: number;
|
|
||||||
static C1R: number;
|
|
||||||
static C1G: number;
|
|
||||||
static C1B: number;
|
|
||||||
static C1A: number;
|
|
||||||
static U1: number;
|
|
||||||
static V1: number;
|
|
||||||
static X2: number;
|
|
||||||
static Y2: number;
|
|
||||||
static C2R: number;
|
|
||||||
static C2G: number;
|
|
||||||
static C2B: number;
|
|
||||||
static C2A: number;
|
|
||||||
static U2: number;
|
|
||||||
static V2: number;
|
|
||||||
static X3: number;
|
|
||||||
static Y3: number;
|
|
||||||
static C3R: number;
|
|
||||||
static C3G: number;
|
|
||||||
static C3B: number;
|
|
||||||
static C3A: number;
|
|
||||||
static U3: number;
|
|
||||||
static V3: number;
|
|
||||||
static X4: number;
|
|
||||||
static Y4: number;
|
|
||||||
static C4R: number;
|
|
||||||
static C4G: number;
|
|
||||||
static C4B: number;
|
|
||||||
static C4A: number;
|
|
||||||
static U4: number;
|
|
||||||
static V4: number;
|
|
||||||
x: number;
|
|
||||||
y: number;
|
|
||||||
scaleX: number;
|
|
||||||
scaleY: number;
|
|
||||||
rotation: number;
|
|
||||||
width: number;
|
|
||||||
height: number;
|
|
||||||
color: Color;
|
|
||||||
path: string;
|
|
||||||
rendererObject: any;
|
|
||||||
region: TextureRegion;
|
|
||||||
offset: ArrayLike<number>;
|
|
||||||
uvs: ArrayLike<number>;
|
|
||||||
tempColor: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
updateOffset(): void;
|
|
||||||
setRegion(region: TextureRegion): void;
|
|
||||||
computeWorldVertices(bone: Bone, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
declare module spine {
|
||||||
class JitterEffect implements VertexEffect {
|
class JitterEffect implements VertexEffect {
|
||||||
jitterX: number;
|
jitterX: number;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
300
spine-ts/build/spine-threejs.d.ts
vendored
300
spine-ts/build/spine-threejs.d.ts
vendored
@ -399,6 +399,156 @@ declare module spine {
|
|||||||
newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
|
newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
declare module spine {
|
||||||
|
abstract class Attachment {
|
||||||
|
name: string;
|
||||||
|
constructor(name: string);
|
||||||
|
}
|
||||||
|
abstract class VertexAttachment extends Attachment {
|
||||||
|
private static nextID;
|
||||||
|
id: number;
|
||||||
|
bones: Array<number>;
|
||||||
|
vertices: ArrayLike<number>;
|
||||||
|
worldVerticesLength: number;
|
||||||
|
constructor(name: string);
|
||||||
|
computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
|
||||||
|
applyDeform(sourceAttachment: VertexAttachment): boolean;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
interface AttachmentLoader {
|
||||||
|
newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
|
||||||
|
newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
|
||||||
|
newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
|
||||||
|
newPathAttachment(skin: Skin, name: string): PathAttachment;
|
||||||
|
newPointAttachment(skin: Skin, name: string): PointAttachment;
|
||||||
|
newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
enum AttachmentType {
|
||||||
|
Region = 0,
|
||||||
|
BoundingBox = 1,
|
||||||
|
Mesh = 2,
|
||||||
|
LinkedMesh = 3,
|
||||||
|
Path = 4,
|
||||||
|
Point = 5,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class BoundingBoxAttachment extends VertexAttachment {
|
||||||
|
color: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class ClippingAttachment extends VertexAttachment {
|
||||||
|
endSlot: SlotData;
|
||||||
|
color: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class MeshAttachment extends VertexAttachment {
|
||||||
|
region: TextureRegion;
|
||||||
|
path: string;
|
||||||
|
regionUVs: ArrayLike<number>;
|
||||||
|
uvs: ArrayLike<number>;
|
||||||
|
triangles: Array<number>;
|
||||||
|
color: Color;
|
||||||
|
hullLength: number;
|
||||||
|
private parentMesh;
|
||||||
|
inheritDeform: boolean;
|
||||||
|
tempColor: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
updateUVs(): void;
|
||||||
|
applyDeform(sourceAttachment: VertexAttachment): boolean;
|
||||||
|
getParentMesh(): MeshAttachment;
|
||||||
|
setParentMesh(parentMesh: MeshAttachment): void;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class PathAttachment extends VertexAttachment {
|
||||||
|
lengths: Array<number>;
|
||||||
|
closed: boolean;
|
||||||
|
constantSpeed: boolean;
|
||||||
|
color: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class PointAttachment extends VertexAttachment {
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
rotation: number;
|
||||||
|
color: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
computeWorldPosition(bone: Bone, point: Vector2): Vector2;
|
||||||
|
computeWorldRotation(bone: Bone): number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class RegionAttachment extends Attachment {
|
||||||
|
static OX1: number;
|
||||||
|
static OY1: number;
|
||||||
|
static OX2: number;
|
||||||
|
static OY2: number;
|
||||||
|
static OX3: number;
|
||||||
|
static OY3: number;
|
||||||
|
static OX4: number;
|
||||||
|
static OY4: number;
|
||||||
|
static X1: number;
|
||||||
|
static Y1: number;
|
||||||
|
static C1R: number;
|
||||||
|
static C1G: number;
|
||||||
|
static C1B: number;
|
||||||
|
static C1A: number;
|
||||||
|
static U1: number;
|
||||||
|
static V1: number;
|
||||||
|
static X2: number;
|
||||||
|
static Y2: number;
|
||||||
|
static C2R: number;
|
||||||
|
static C2G: number;
|
||||||
|
static C2B: number;
|
||||||
|
static C2A: number;
|
||||||
|
static U2: number;
|
||||||
|
static V2: number;
|
||||||
|
static X3: number;
|
||||||
|
static Y3: number;
|
||||||
|
static C3R: number;
|
||||||
|
static C3G: number;
|
||||||
|
static C3B: number;
|
||||||
|
static C3A: number;
|
||||||
|
static U3: number;
|
||||||
|
static V3: number;
|
||||||
|
static X4: number;
|
||||||
|
static Y4: number;
|
||||||
|
static C4R: number;
|
||||||
|
static C4G: number;
|
||||||
|
static C4B: number;
|
||||||
|
static C4A: number;
|
||||||
|
static U4: number;
|
||||||
|
static V4: number;
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
scaleX: number;
|
||||||
|
scaleY: number;
|
||||||
|
rotation: number;
|
||||||
|
width: number;
|
||||||
|
height: number;
|
||||||
|
color: Color;
|
||||||
|
path: string;
|
||||||
|
rendererObject: any;
|
||||||
|
region: TextureRegion;
|
||||||
|
offset: ArrayLike<number>;
|
||||||
|
uvs: ArrayLike<number>;
|
||||||
|
tempColor: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
updateOffset(): void;
|
||||||
|
setRegion(region: TextureRegion): void;
|
||||||
|
computeWorldVertices(bone: Bone, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
|
||||||
|
}
|
||||||
|
}
|
||||||
declare module spine {
|
declare module spine {
|
||||||
enum BlendMode {
|
enum BlendMode {
|
||||||
Normal = 0,
|
Normal = 0,
|
||||||
@ -1045,156 +1195,6 @@ declare module spine {
|
|||||||
end(): void;
|
end(): void;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module spine {
|
|
||||||
abstract class Attachment {
|
|
||||||
name: string;
|
|
||||||
constructor(name: string);
|
|
||||||
}
|
|
||||||
abstract class VertexAttachment extends Attachment {
|
|
||||||
private static nextID;
|
|
||||||
id: number;
|
|
||||||
bones: Array<number>;
|
|
||||||
vertices: ArrayLike<number>;
|
|
||||||
worldVerticesLength: number;
|
|
||||||
constructor(name: string);
|
|
||||||
computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
|
|
||||||
applyDeform(sourceAttachment: VertexAttachment): boolean;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
interface AttachmentLoader {
|
|
||||||
newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
|
|
||||||
newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
|
|
||||||
newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
|
|
||||||
newPathAttachment(skin: Skin, name: string): PathAttachment;
|
|
||||||
newPointAttachment(skin: Skin, name: string): PointAttachment;
|
|
||||||
newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
enum AttachmentType {
|
|
||||||
Region = 0,
|
|
||||||
BoundingBox = 1,
|
|
||||||
Mesh = 2,
|
|
||||||
LinkedMesh = 3,
|
|
||||||
Path = 4,
|
|
||||||
Point = 5,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class BoundingBoxAttachment extends VertexAttachment {
|
|
||||||
color: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class ClippingAttachment extends VertexAttachment {
|
|
||||||
endSlot: SlotData;
|
|
||||||
color: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class MeshAttachment extends VertexAttachment {
|
|
||||||
region: TextureRegion;
|
|
||||||
path: string;
|
|
||||||
regionUVs: ArrayLike<number>;
|
|
||||||
uvs: ArrayLike<number>;
|
|
||||||
triangles: Array<number>;
|
|
||||||
color: Color;
|
|
||||||
hullLength: number;
|
|
||||||
private parentMesh;
|
|
||||||
inheritDeform: boolean;
|
|
||||||
tempColor: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
updateUVs(): void;
|
|
||||||
applyDeform(sourceAttachment: VertexAttachment): boolean;
|
|
||||||
getParentMesh(): MeshAttachment;
|
|
||||||
setParentMesh(parentMesh: MeshAttachment): void;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class PathAttachment extends VertexAttachment {
|
|
||||||
lengths: Array<number>;
|
|
||||||
closed: boolean;
|
|
||||||
constantSpeed: boolean;
|
|
||||||
color: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class PointAttachment extends VertexAttachment {
|
|
||||||
x: number;
|
|
||||||
y: number;
|
|
||||||
rotation: number;
|
|
||||||
color: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
computeWorldPosition(bone: Bone, point: Vector2): Vector2;
|
|
||||||
computeWorldRotation(bone: Bone): number;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class RegionAttachment extends Attachment {
|
|
||||||
static OX1: number;
|
|
||||||
static OY1: number;
|
|
||||||
static OX2: number;
|
|
||||||
static OY2: number;
|
|
||||||
static OX3: number;
|
|
||||||
static OY3: number;
|
|
||||||
static OX4: number;
|
|
||||||
static OY4: number;
|
|
||||||
static X1: number;
|
|
||||||
static Y1: number;
|
|
||||||
static C1R: number;
|
|
||||||
static C1G: number;
|
|
||||||
static C1B: number;
|
|
||||||
static C1A: number;
|
|
||||||
static U1: number;
|
|
||||||
static V1: number;
|
|
||||||
static X2: number;
|
|
||||||
static Y2: number;
|
|
||||||
static C2R: number;
|
|
||||||
static C2G: number;
|
|
||||||
static C2B: number;
|
|
||||||
static C2A: number;
|
|
||||||
static U2: number;
|
|
||||||
static V2: number;
|
|
||||||
static X3: number;
|
|
||||||
static Y3: number;
|
|
||||||
static C3R: number;
|
|
||||||
static C3G: number;
|
|
||||||
static C3B: number;
|
|
||||||
static C3A: number;
|
|
||||||
static U3: number;
|
|
||||||
static V3: number;
|
|
||||||
static X4: number;
|
|
||||||
static Y4: number;
|
|
||||||
static C4R: number;
|
|
||||||
static C4G: number;
|
|
||||||
static C4B: number;
|
|
||||||
static C4A: number;
|
|
||||||
static U4: number;
|
|
||||||
static V4: number;
|
|
||||||
x: number;
|
|
||||||
y: number;
|
|
||||||
scaleX: number;
|
|
||||||
scaleY: number;
|
|
||||||
rotation: number;
|
|
||||||
width: number;
|
|
||||||
height: number;
|
|
||||||
color: Color;
|
|
||||||
path: string;
|
|
||||||
rendererObject: any;
|
|
||||||
region: TextureRegion;
|
|
||||||
offset: ArrayLike<number>;
|
|
||||||
uvs: ArrayLike<number>;
|
|
||||||
tempColor: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
updateOffset(): void;
|
|
||||||
setRegion(region: TextureRegion): void;
|
|
||||||
computeWorldVertices(bone: Bone, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
declare module spine {
|
||||||
class JitterEffect implements VertexEffect {
|
class JitterEffect implements VertexEffect {
|
||||||
jitterX: number;
|
jitterX: number;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
332
spine-ts/build/spine-webgl.d.ts
vendored
332
spine-ts/build/spine-webgl.d.ts
vendored
@ -399,6 +399,156 @@ declare module spine {
|
|||||||
newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
|
newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
declare module spine {
|
||||||
|
abstract class Attachment {
|
||||||
|
name: string;
|
||||||
|
constructor(name: string);
|
||||||
|
}
|
||||||
|
abstract class VertexAttachment extends Attachment {
|
||||||
|
private static nextID;
|
||||||
|
id: number;
|
||||||
|
bones: Array<number>;
|
||||||
|
vertices: ArrayLike<number>;
|
||||||
|
worldVerticesLength: number;
|
||||||
|
constructor(name: string);
|
||||||
|
computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
|
||||||
|
applyDeform(sourceAttachment: VertexAttachment): boolean;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
interface AttachmentLoader {
|
||||||
|
newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
|
||||||
|
newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
|
||||||
|
newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
|
||||||
|
newPathAttachment(skin: Skin, name: string): PathAttachment;
|
||||||
|
newPointAttachment(skin: Skin, name: string): PointAttachment;
|
||||||
|
newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
enum AttachmentType {
|
||||||
|
Region = 0,
|
||||||
|
BoundingBox = 1,
|
||||||
|
Mesh = 2,
|
||||||
|
LinkedMesh = 3,
|
||||||
|
Path = 4,
|
||||||
|
Point = 5,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class BoundingBoxAttachment extends VertexAttachment {
|
||||||
|
color: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class ClippingAttachment extends VertexAttachment {
|
||||||
|
endSlot: SlotData;
|
||||||
|
color: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class MeshAttachment extends VertexAttachment {
|
||||||
|
region: TextureRegion;
|
||||||
|
path: string;
|
||||||
|
regionUVs: ArrayLike<number>;
|
||||||
|
uvs: ArrayLike<number>;
|
||||||
|
triangles: Array<number>;
|
||||||
|
color: Color;
|
||||||
|
hullLength: number;
|
||||||
|
private parentMesh;
|
||||||
|
inheritDeform: boolean;
|
||||||
|
tempColor: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
updateUVs(): void;
|
||||||
|
applyDeform(sourceAttachment: VertexAttachment): boolean;
|
||||||
|
getParentMesh(): MeshAttachment;
|
||||||
|
setParentMesh(parentMesh: MeshAttachment): void;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class PathAttachment extends VertexAttachment {
|
||||||
|
lengths: Array<number>;
|
||||||
|
closed: boolean;
|
||||||
|
constantSpeed: boolean;
|
||||||
|
color: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class PointAttachment extends VertexAttachment {
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
rotation: number;
|
||||||
|
color: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
computeWorldPosition(bone: Bone, point: Vector2): Vector2;
|
||||||
|
computeWorldRotation(bone: Bone): number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class RegionAttachment extends Attachment {
|
||||||
|
static OX1: number;
|
||||||
|
static OY1: number;
|
||||||
|
static OX2: number;
|
||||||
|
static OY2: number;
|
||||||
|
static OX3: number;
|
||||||
|
static OY3: number;
|
||||||
|
static OX4: number;
|
||||||
|
static OY4: number;
|
||||||
|
static X1: number;
|
||||||
|
static Y1: number;
|
||||||
|
static C1R: number;
|
||||||
|
static C1G: number;
|
||||||
|
static C1B: number;
|
||||||
|
static C1A: number;
|
||||||
|
static U1: number;
|
||||||
|
static V1: number;
|
||||||
|
static X2: number;
|
||||||
|
static Y2: number;
|
||||||
|
static C2R: number;
|
||||||
|
static C2G: number;
|
||||||
|
static C2B: number;
|
||||||
|
static C2A: number;
|
||||||
|
static U2: number;
|
||||||
|
static V2: number;
|
||||||
|
static X3: number;
|
||||||
|
static Y3: number;
|
||||||
|
static C3R: number;
|
||||||
|
static C3G: number;
|
||||||
|
static C3B: number;
|
||||||
|
static C3A: number;
|
||||||
|
static U3: number;
|
||||||
|
static V3: number;
|
||||||
|
static X4: number;
|
||||||
|
static Y4: number;
|
||||||
|
static C4R: number;
|
||||||
|
static C4G: number;
|
||||||
|
static C4B: number;
|
||||||
|
static C4A: number;
|
||||||
|
static U4: number;
|
||||||
|
static V4: number;
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
scaleX: number;
|
||||||
|
scaleY: number;
|
||||||
|
rotation: number;
|
||||||
|
width: number;
|
||||||
|
height: number;
|
||||||
|
color: Color;
|
||||||
|
path: string;
|
||||||
|
rendererObject: any;
|
||||||
|
region: TextureRegion;
|
||||||
|
offset: ArrayLike<number>;
|
||||||
|
uvs: ArrayLike<number>;
|
||||||
|
tempColor: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
updateOffset(): void;
|
||||||
|
setRegion(region: TextureRegion): void;
|
||||||
|
computeWorldVertices(bone: Bone, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
|
||||||
|
}
|
||||||
|
}
|
||||||
declare module spine {
|
declare module spine {
|
||||||
enum BlendMode {
|
enum BlendMode {
|
||||||
Normal = 0,
|
Normal = 0,
|
||||||
@ -1045,156 +1195,6 @@ declare module spine {
|
|||||||
end(): void;
|
end(): void;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module spine {
|
|
||||||
abstract class Attachment {
|
|
||||||
name: string;
|
|
||||||
constructor(name: string);
|
|
||||||
}
|
|
||||||
abstract class VertexAttachment extends Attachment {
|
|
||||||
private static nextID;
|
|
||||||
id: number;
|
|
||||||
bones: Array<number>;
|
|
||||||
vertices: ArrayLike<number>;
|
|
||||||
worldVerticesLength: number;
|
|
||||||
constructor(name: string);
|
|
||||||
computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
|
|
||||||
applyDeform(sourceAttachment: VertexAttachment): boolean;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
interface AttachmentLoader {
|
|
||||||
newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
|
|
||||||
newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
|
|
||||||
newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
|
|
||||||
newPathAttachment(skin: Skin, name: string): PathAttachment;
|
|
||||||
newPointAttachment(skin: Skin, name: string): PointAttachment;
|
|
||||||
newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
enum AttachmentType {
|
|
||||||
Region = 0,
|
|
||||||
BoundingBox = 1,
|
|
||||||
Mesh = 2,
|
|
||||||
LinkedMesh = 3,
|
|
||||||
Path = 4,
|
|
||||||
Point = 5,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class BoundingBoxAttachment extends VertexAttachment {
|
|
||||||
color: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class ClippingAttachment extends VertexAttachment {
|
|
||||||
endSlot: SlotData;
|
|
||||||
color: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class MeshAttachment extends VertexAttachment {
|
|
||||||
region: TextureRegion;
|
|
||||||
path: string;
|
|
||||||
regionUVs: ArrayLike<number>;
|
|
||||||
uvs: ArrayLike<number>;
|
|
||||||
triangles: Array<number>;
|
|
||||||
color: Color;
|
|
||||||
hullLength: number;
|
|
||||||
private parentMesh;
|
|
||||||
inheritDeform: boolean;
|
|
||||||
tempColor: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
updateUVs(): void;
|
|
||||||
applyDeform(sourceAttachment: VertexAttachment): boolean;
|
|
||||||
getParentMesh(): MeshAttachment;
|
|
||||||
setParentMesh(parentMesh: MeshAttachment): void;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class PathAttachment extends VertexAttachment {
|
|
||||||
lengths: Array<number>;
|
|
||||||
closed: boolean;
|
|
||||||
constantSpeed: boolean;
|
|
||||||
color: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class PointAttachment extends VertexAttachment {
|
|
||||||
x: number;
|
|
||||||
y: number;
|
|
||||||
rotation: number;
|
|
||||||
color: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
computeWorldPosition(bone: Bone, point: Vector2): Vector2;
|
|
||||||
computeWorldRotation(bone: Bone): number;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class RegionAttachment extends Attachment {
|
|
||||||
static OX1: number;
|
|
||||||
static OY1: number;
|
|
||||||
static OX2: number;
|
|
||||||
static OY2: number;
|
|
||||||
static OX3: number;
|
|
||||||
static OY3: number;
|
|
||||||
static OX4: number;
|
|
||||||
static OY4: number;
|
|
||||||
static X1: number;
|
|
||||||
static Y1: number;
|
|
||||||
static C1R: number;
|
|
||||||
static C1G: number;
|
|
||||||
static C1B: number;
|
|
||||||
static C1A: number;
|
|
||||||
static U1: number;
|
|
||||||
static V1: number;
|
|
||||||
static X2: number;
|
|
||||||
static Y2: number;
|
|
||||||
static C2R: number;
|
|
||||||
static C2G: number;
|
|
||||||
static C2B: number;
|
|
||||||
static C2A: number;
|
|
||||||
static U2: number;
|
|
||||||
static V2: number;
|
|
||||||
static X3: number;
|
|
||||||
static Y3: number;
|
|
||||||
static C3R: number;
|
|
||||||
static C3G: number;
|
|
||||||
static C3B: number;
|
|
||||||
static C3A: number;
|
|
||||||
static U3: number;
|
|
||||||
static V3: number;
|
|
||||||
static X4: number;
|
|
||||||
static Y4: number;
|
|
||||||
static C4R: number;
|
|
||||||
static C4G: number;
|
|
||||||
static C4B: number;
|
|
||||||
static C4A: number;
|
|
||||||
static U4: number;
|
|
||||||
static V4: number;
|
|
||||||
x: number;
|
|
||||||
y: number;
|
|
||||||
scaleX: number;
|
|
||||||
scaleY: number;
|
|
||||||
rotation: number;
|
|
||||||
width: number;
|
|
||||||
height: number;
|
|
||||||
color: Color;
|
|
||||||
path: string;
|
|
||||||
rendererObject: any;
|
|
||||||
region: TextureRegion;
|
|
||||||
offset: ArrayLike<number>;
|
|
||||||
uvs: ArrayLike<number>;
|
|
||||||
tempColor: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
updateOffset(): void;
|
|
||||||
setRegion(region: TextureRegion): void;
|
|
||||||
computeWorldVertices(bone: Bone, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
declare module spine {
|
||||||
class JitterEffect implements VertexEffect {
|
class JitterEffect implements VertexEffect {
|
||||||
jitterX: number;
|
jitterX: number;
|
||||||
@ -1311,22 +1311,22 @@ declare module spine.webgl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module spine.webgl {
|
declare module spine.webgl {
|
||||||
const M00 = 0;
|
const M00: number;
|
||||||
const M01 = 4;
|
const M01: number;
|
||||||
const M02 = 8;
|
const M02: number;
|
||||||
const M03 = 12;
|
const M03: number;
|
||||||
const M10 = 1;
|
const M10: number;
|
||||||
const M11 = 5;
|
const M11: number;
|
||||||
const M12 = 9;
|
const M12: number;
|
||||||
const M13 = 13;
|
const M13: number;
|
||||||
const M20 = 2;
|
const M20: number;
|
||||||
const M21 = 6;
|
const M21: number;
|
||||||
const M22 = 10;
|
const M22: number;
|
||||||
const M23 = 14;
|
const M23: number;
|
||||||
const M30 = 3;
|
const M30: number;
|
||||||
const M31 = 7;
|
const M31: number;
|
||||||
const M32 = 11;
|
const M32: number;
|
||||||
const M33 = 15;
|
const M33: number;
|
||||||
class Matrix4 {
|
class Matrix4 {
|
||||||
temp: Float32Array;
|
temp: Float32Array;
|
||||||
values: Float32Array;
|
values: Float32Array;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
332
spine-ts/build/spine-widget.d.ts
vendored
332
spine-ts/build/spine-widget.d.ts
vendored
@ -399,6 +399,156 @@ declare module spine {
|
|||||||
newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
|
newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
declare module spine {
|
||||||
|
abstract class Attachment {
|
||||||
|
name: string;
|
||||||
|
constructor(name: string);
|
||||||
|
}
|
||||||
|
abstract class VertexAttachment extends Attachment {
|
||||||
|
private static nextID;
|
||||||
|
id: number;
|
||||||
|
bones: Array<number>;
|
||||||
|
vertices: ArrayLike<number>;
|
||||||
|
worldVerticesLength: number;
|
||||||
|
constructor(name: string);
|
||||||
|
computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
|
||||||
|
applyDeform(sourceAttachment: VertexAttachment): boolean;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
interface AttachmentLoader {
|
||||||
|
newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
|
||||||
|
newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
|
||||||
|
newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
|
||||||
|
newPathAttachment(skin: Skin, name: string): PathAttachment;
|
||||||
|
newPointAttachment(skin: Skin, name: string): PointAttachment;
|
||||||
|
newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
enum AttachmentType {
|
||||||
|
Region = 0,
|
||||||
|
BoundingBox = 1,
|
||||||
|
Mesh = 2,
|
||||||
|
LinkedMesh = 3,
|
||||||
|
Path = 4,
|
||||||
|
Point = 5,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class BoundingBoxAttachment extends VertexAttachment {
|
||||||
|
color: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class ClippingAttachment extends VertexAttachment {
|
||||||
|
endSlot: SlotData;
|
||||||
|
color: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class MeshAttachment extends VertexAttachment {
|
||||||
|
region: TextureRegion;
|
||||||
|
path: string;
|
||||||
|
regionUVs: ArrayLike<number>;
|
||||||
|
uvs: ArrayLike<number>;
|
||||||
|
triangles: Array<number>;
|
||||||
|
color: Color;
|
||||||
|
hullLength: number;
|
||||||
|
private parentMesh;
|
||||||
|
inheritDeform: boolean;
|
||||||
|
tempColor: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
updateUVs(): void;
|
||||||
|
applyDeform(sourceAttachment: VertexAttachment): boolean;
|
||||||
|
getParentMesh(): MeshAttachment;
|
||||||
|
setParentMesh(parentMesh: MeshAttachment): void;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class PathAttachment extends VertexAttachment {
|
||||||
|
lengths: Array<number>;
|
||||||
|
closed: boolean;
|
||||||
|
constantSpeed: boolean;
|
||||||
|
color: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class PointAttachment extends VertexAttachment {
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
rotation: number;
|
||||||
|
color: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
computeWorldPosition(bone: Bone, point: Vector2): Vector2;
|
||||||
|
computeWorldRotation(bone: Bone): number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
declare module spine {
|
||||||
|
class RegionAttachment extends Attachment {
|
||||||
|
static OX1: number;
|
||||||
|
static OY1: number;
|
||||||
|
static OX2: number;
|
||||||
|
static OY2: number;
|
||||||
|
static OX3: number;
|
||||||
|
static OY3: number;
|
||||||
|
static OX4: number;
|
||||||
|
static OY4: number;
|
||||||
|
static X1: number;
|
||||||
|
static Y1: number;
|
||||||
|
static C1R: number;
|
||||||
|
static C1G: number;
|
||||||
|
static C1B: number;
|
||||||
|
static C1A: number;
|
||||||
|
static U1: number;
|
||||||
|
static V1: number;
|
||||||
|
static X2: number;
|
||||||
|
static Y2: number;
|
||||||
|
static C2R: number;
|
||||||
|
static C2G: number;
|
||||||
|
static C2B: number;
|
||||||
|
static C2A: number;
|
||||||
|
static U2: number;
|
||||||
|
static V2: number;
|
||||||
|
static X3: number;
|
||||||
|
static Y3: number;
|
||||||
|
static C3R: number;
|
||||||
|
static C3G: number;
|
||||||
|
static C3B: number;
|
||||||
|
static C3A: number;
|
||||||
|
static U3: number;
|
||||||
|
static V3: number;
|
||||||
|
static X4: number;
|
||||||
|
static Y4: number;
|
||||||
|
static C4R: number;
|
||||||
|
static C4G: number;
|
||||||
|
static C4B: number;
|
||||||
|
static C4A: number;
|
||||||
|
static U4: number;
|
||||||
|
static V4: number;
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
scaleX: number;
|
||||||
|
scaleY: number;
|
||||||
|
rotation: number;
|
||||||
|
width: number;
|
||||||
|
height: number;
|
||||||
|
color: Color;
|
||||||
|
path: string;
|
||||||
|
rendererObject: any;
|
||||||
|
region: TextureRegion;
|
||||||
|
offset: ArrayLike<number>;
|
||||||
|
uvs: ArrayLike<number>;
|
||||||
|
tempColor: Color;
|
||||||
|
constructor(name: string);
|
||||||
|
updateOffset(): void;
|
||||||
|
setRegion(region: TextureRegion): void;
|
||||||
|
computeWorldVertices(bone: Bone, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
|
||||||
|
}
|
||||||
|
}
|
||||||
declare module spine {
|
declare module spine {
|
||||||
enum BlendMode {
|
enum BlendMode {
|
||||||
Normal = 0,
|
Normal = 0,
|
||||||
@ -1045,156 +1195,6 @@ declare module spine {
|
|||||||
end(): void;
|
end(): void;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module spine {
|
|
||||||
abstract class Attachment {
|
|
||||||
name: string;
|
|
||||||
constructor(name: string);
|
|
||||||
}
|
|
||||||
abstract class VertexAttachment extends Attachment {
|
|
||||||
private static nextID;
|
|
||||||
id: number;
|
|
||||||
bones: Array<number>;
|
|
||||||
vertices: ArrayLike<number>;
|
|
||||||
worldVerticesLength: number;
|
|
||||||
constructor(name: string);
|
|
||||||
computeWorldVertices(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
|
|
||||||
applyDeform(sourceAttachment: VertexAttachment): boolean;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
interface AttachmentLoader {
|
|
||||||
newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
|
|
||||||
newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
|
|
||||||
newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
|
|
||||||
newPathAttachment(skin: Skin, name: string): PathAttachment;
|
|
||||||
newPointAttachment(skin: Skin, name: string): PointAttachment;
|
|
||||||
newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
enum AttachmentType {
|
|
||||||
Region = 0,
|
|
||||||
BoundingBox = 1,
|
|
||||||
Mesh = 2,
|
|
||||||
LinkedMesh = 3,
|
|
||||||
Path = 4,
|
|
||||||
Point = 5,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class BoundingBoxAttachment extends VertexAttachment {
|
|
||||||
color: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class ClippingAttachment extends VertexAttachment {
|
|
||||||
endSlot: SlotData;
|
|
||||||
color: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class MeshAttachment extends VertexAttachment {
|
|
||||||
region: TextureRegion;
|
|
||||||
path: string;
|
|
||||||
regionUVs: ArrayLike<number>;
|
|
||||||
uvs: ArrayLike<number>;
|
|
||||||
triangles: Array<number>;
|
|
||||||
color: Color;
|
|
||||||
hullLength: number;
|
|
||||||
private parentMesh;
|
|
||||||
inheritDeform: boolean;
|
|
||||||
tempColor: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
updateUVs(): void;
|
|
||||||
applyDeform(sourceAttachment: VertexAttachment): boolean;
|
|
||||||
getParentMesh(): MeshAttachment;
|
|
||||||
setParentMesh(parentMesh: MeshAttachment): void;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class PathAttachment extends VertexAttachment {
|
|
||||||
lengths: Array<number>;
|
|
||||||
closed: boolean;
|
|
||||||
constantSpeed: boolean;
|
|
||||||
color: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class PointAttachment extends VertexAttachment {
|
|
||||||
x: number;
|
|
||||||
y: number;
|
|
||||||
rotation: number;
|
|
||||||
color: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
computeWorldPosition(bone: Bone, point: Vector2): Vector2;
|
|
||||||
computeWorldRotation(bone: Bone): number;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
|
||||||
class RegionAttachment extends Attachment {
|
|
||||||
static OX1: number;
|
|
||||||
static OY1: number;
|
|
||||||
static OX2: number;
|
|
||||||
static OY2: number;
|
|
||||||
static OX3: number;
|
|
||||||
static OY3: number;
|
|
||||||
static OX4: number;
|
|
||||||
static OY4: number;
|
|
||||||
static X1: number;
|
|
||||||
static Y1: number;
|
|
||||||
static C1R: number;
|
|
||||||
static C1G: number;
|
|
||||||
static C1B: number;
|
|
||||||
static C1A: number;
|
|
||||||
static U1: number;
|
|
||||||
static V1: number;
|
|
||||||
static X2: number;
|
|
||||||
static Y2: number;
|
|
||||||
static C2R: number;
|
|
||||||
static C2G: number;
|
|
||||||
static C2B: number;
|
|
||||||
static C2A: number;
|
|
||||||
static U2: number;
|
|
||||||
static V2: number;
|
|
||||||
static X3: number;
|
|
||||||
static Y3: number;
|
|
||||||
static C3R: number;
|
|
||||||
static C3G: number;
|
|
||||||
static C3B: number;
|
|
||||||
static C3A: number;
|
|
||||||
static U3: number;
|
|
||||||
static V3: number;
|
|
||||||
static X4: number;
|
|
||||||
static Y4: number;
|
|
||||||
static C4R: number;
|
|
||||||
static C4G: number;
|
|
||||||
static C4B: number;
|
|
||||||
static C4A: number;
|
|
||||||
static U4: number;
|
|
||||||
static V4: number;
|
|
||||||
x: number;
|
|
||||||
y: number;
|
|
||||||
scaleX: number;
|
|
||||||
scaleY: number;
|
|
||||||
rotation: number;
|
|
||||||
width: number;
|
|
||||||
height: number;
|
|
||||||
color: Color;
|
|
||||||
path: string;
|
|
||||||
rendererObject: any;
|
|
||||||
region: TextureRegion;
|
|
||||||
offset: ArrayLike<number>;
|
|
||||||
uvs: ArrayLike<number>;
|
|
||||||
tempColor: Color;
|
|
||||||
constructor(name: string);
|
|
||||||
updateOffset(): void;
|
|
||||||
setRegion(region: TextureRegion): void;
|
|
||||||
computeWorldVertices(bone: Bone, worldVertices: ArrayLike<number>, offset: number, stride: number): void;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare module spine {
|
declare module spine {
|
||||||
class JitterEffect implements VertexEffect {
|
class JitterEffect implements VertexEffect {
|
||||||
jitterX: number;
|
jitterX: number;
|
||||||
@ -1311,22 +1311,22 @@ declare module spine.webgl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module spine.webgl {
|
declare module spine.webgl {
|
||||||
const M00 = 0;
|
const M00: number;
|
||||||
const M01 = 4;
|
const M01: number;
|
||||||
const M02 = 8;
|
const M02: number;
|
||||||
const M03 = 12;
|
const M03: number;
|
||||||
const M10 = 1;
|
const M10: number;
|
||||||
const M11 = 5;
|
const M11: number;
|
||||||
const M12 = 9;
|
const M12: number;
|
||||||
const M13 = 13;
|
const M13: number;
|
||||||
const M20 = 2;
|
const M20: number;
|
||||||
const M21 = 6;
|
const M21: number;
|
||||||
const M22 = 10;
|
const M22: number;
|
||||||
const M23 = 14;
|
const M23: number;
|
||||||
const M30 = 3;
|
const M30: number;
|
||||||
const M31 = 7;
|
const M31: number;
|
||||||
const M32 = 11;
|
const M32: number;
|
||||||
const M33 = 15;
|
const M33: number;
|
||||||
class Matrix4 {
|
class Matrix4 {
|
||||||
temp: Float32Array;
|
temp: Float32Array;
|
||||||
values: Float32Array;
|
values: Float32Array;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -708,28 +708,24 @@ module spine {
|
|||||||
if (!(slotAttachment instanceof VertexAttachment) || !(<VertexAttachment>slotAttachment).applyDeform(this.attachment)) return;
|
if (!(slotAttachment instanceof VertexAttachment) || !(<VertexAttachment>slotAttachment).applyDeform(this.attachment)) return;
|
||||||
|
|
||||||
let verticesArray: Array<number> = slot.attachmentVertices;
|
let verticesArray: Array<number> = slot.attachmentVertices;
|
||||||
|
if (verticesArray.length == 0) alpha = 1;
|
||||||
|
|
||||||
let frameVertices = this.frameVertices;
|
let frameVertices = this.frameVertices;
|
||||||
let vertexCount = frameVertices[0].length;
|
let vertexCount = frameVertices[0].length;
|
||||||
let vertices: Array<number> = Utils.setArraySize(verticesArray, vertexCount);
|
|
||||||
|
|
||||||
let frames = this.frames;
|
let frames = this.frames;
|
||||||
if (time < frames[0]) {
|
if (time < frames[0]) {
|
||||||
let vertexAttachment = <VertexAttachment>slotAttachment;
|
let vertexAttachment = <VertexAttachment>slotAttachment;
|
||||||
switch (pose) {
|
switch (pose) {
|
||||||
case MixPose.setup:
|
case MixPose.setup:
|
||||||
var zeroVertices: ArrayLike<number>;
|
verticesArray.length = 0;
|
||||||
if (vertexAttachment.bones == null) {
|
|
||||||
// Unweighted vertex positions (setup pose).
|
|
||||||
zeroVertices = vertexAttachment.vertices;
|
|
||||||
} else {
|
|
||||||
// Weighted deform offsets (zeros).
|
|
||||||
zeroVertices = zeros;
|
|
||||||
if (zeroVertices.length < vertexCount) zeros = zeroVertices = Utils.newFloatArray(vertexCount);
|
|
||||||
}
|
|
||||||
Utils.arrayCopy(zeroVertices, 0, vertices, 0, vertexCount);
|
|
||||||
return;
|
return;
|
||||||
case MixPose.current:
|
case MixPose.current:
|
||||||
if (alpha == 1) break;
|
if (alpha == 1) {
|
||||||
|
verticesArray.length = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
let vertices: Array<number> = Utils.setArraySize(verticesArray, vertexCount);
|
||||||
if (vertexAttachment.bones == null) {
|
if (vertexAttachment.bones == null) {
|
||||||
// Unweighted vertex positions.
|
// Unweighted vertex positions.
|
||||||
var setupVertices = vertexAttachment.vertices;
|
var setupVertices = vertexAttachment.vertices;
|
||||||
@ -745,6 +741,7 @@ module spine {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let vertices: Array<number> = Utils.setArraySize(verticesArray, vertexCount);
|
||||||
if (time >= frames[frames.length - 1]) { // Time is after last frame.
|
if (time >= frames[frames.length - 1]) { // Time is after last frame.
|
||||||
let lastVertices = frameVertices[frames.length - 1];
|
let lastVertices = frameVertices[frames.length - 1];
|
||||||
if (alpha == 1) {
|
if (alpha == 1) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user