pixi5-dragonbones
Version:
PixiJS plugin for DragonBones
1,643 lines • 251 kB
TypeScript
/**
* The MIT License (MIT)
*
* Copyright (c) 2012-2018 DragonBones team and other contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
declare namespace dragonBones {
/**
* @private
*/
const enum BinaryOffset {
WeigthBoneCount = 0,
WeigthFloatOffset = 1,
WeigthBoneIndices = 2,
GeometryVertexCount = 0,
GeometryTriangleCount = 1,
GeometryFloatOffset = 2,
GeometryWeightOffset = 3,
GeometryVertexIndices = 4,
TimelineScale = 0,
TimelineOffset = 1,
TimelineKeyFrameCount = 2,
TimelineFrameValueCount = 3,
TimelineFrameValueOffset = 4,
TimelineFrameOffset = 5,
FramePosition = 0,
FrameTweenType = 1,
FrameTweenEasingOrCurveSampleCount = 2,
FrameCurveSamples = 3,
DeformVertexOffset = 0,
DeformCount = 1,
DeformValueCount = 2,
DeformValueOffset = 3,
DeformFloatOffset = 4
}
/**
* @private
*/
const enum ArmatureType {
Armature = 0,
MovieClip = 1,
Stage = 2
}
/**
* @private
*/
const enum BoneType {
Bone = 0,
Surface = 1
}
/**
* @private
*/
const enum DisplayType {
Image = 0,
Armature = 1,
Mesh = 2,
BoundingBox = 3,
Path = 4
}
/**
* - Bounding box type.
* @version DragonBones 5.0
* @language en_US
*/
/**
* - 边界框类型。
* @version DragonBones 5.0
* @language zh_CN
*/
const enum BoundingBoxType {
Rectangle = 0,
Ellipse = 1,
Polygon = 2
}
/**
* @private
*/
const enum ActionType {
Play = 0,
Frame = 10,
Sound = 11
}
/**
* @private
*/
const enum BlendMode {
Normal = 0,
Add = 1,
Alpha = 2,
Darken = 3,
Difference = 4,
Erase = 5,
HardLight = 6,
Invert = 7,
Layer = 8,
Lighten = 9,
Multiply = 10,
Overlay = 11,
Screen = 12,
Subtract = 13
}
/**
* @private
*/
const enum TweenType {
None = 0,
Line = 1,
Curve = 2,
QuadIn = 3,
QuadOut = 4,
QuadInOut = 5
}
/**
* @private
*/
const enum TimelineType {
Action = 0,
ZOrder = 1,
BoneAll = 10,
BoneTranslate = 11,
BoneRotate = 12,
BoneScale = 13,
Surface = 50,
BoneAlpha = 60,
SlotDisplay = 20,
SlotColor = 21,
SlotDeform = 22,
SlotZIndex = 23,
SlotAlpha = 24,
IKConstraint = 30,
AnimationProgress = 40,
AnimationWeight = 41,
AnimationParameter = 42
}
/**
* - Offset mode.
* @version DragonBones 5.5
* @language en_US
*/
/**
* - 偏移模式。
* @version DragonBones 5.5
* @language zh_CN
*/
const enum OffsetMode {
None = 0,
Additive = 1,
Override = 2
}
/**
* - Animation fade out mode.
* @version DragonBones 4.5
* @language en_US
*/
/**
* - 动画淡出模式。
* @version DragonBones 4.5
* @language zh_CN
*/
const enum AnimationFadeOutMode {
/**
* - Fade out the animation states of the same layer.
* @language en_US
*/
/**
* - 淡出同层的动画状态。
* @language zh_CN
*/
SameLayer = 1,
/**
* - Fade out the animation states of the same group.
* @language en_US
*/
/**
* - 淡出同组的动画状态。
* @language zh_CN
*/
SameGroup = 2,
/**
* - Fade out the animation states of the same layer and group.
* @language en_US
*/
/**
* - 淡出同层并且同组的动画状态。
* @language zh_CN
*/
SameLayerAndGroup = 3,
/**
* - Fade out of all animation states.
* @language en_US
*/
/**
* - 淡出所有的动画状态。
* @language zh_CN
*/
All = 4,
/**
* - Does not replace the animation state with the same name.
* @language en_US
*/
/**
* - 不替换同名的动画状态。
* @language zh_CN
*/
Single = 5
}
/**
* @private
*/
const enum AnimationBlendType {
None = 0,
E1D = 1
}
/**
* @private
*/
const enum AnimationBlendMode {
Additive = 0,
Override = 1
}
/**
* @private
*/
const enum ConstraintType {
IK = 0,
Path = 1
}
/**
* @private
*/
const enum PositionMode {
Fixed = 0,
Percent = 1
}
/**
* @private
*/
const enum SpacingMode {
Length = 0,
Fixed = 1,
Percent = 2
}
/**
* @private
*/
const enum RotateMode {
Tangent = 0,
Chain = 1,
ChainScale = 2
}
/**
* @private
*/
interface Map<T> {
[key: string]: T;
}
/**
* @private
*/
class DragonBones {
static readonly VERSION: string;
static yDown: boolean;
static debug: boolean;
static debugDraw: boolean;
private readonly _clock;
private readonly _events;
private readonly _objects;
private _eventManager;
constructor(eventManager: IEventDispatcher);
advanceTime(passedTime: number): void;
bufferEvent(value: EventObject): void;
bufferObject(object: BaseObject): void;
readonly clock: WorldClock;
readonly eventManager: IEventDispatcher;
}
}
declare var __extends: any;
declare var exports: any;
declare var module: any;
declare var define: any;
/**
* The MIT License (MIT)
*
* Copyright (c) 2012-2018 DragonBones team and other contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
declare namespace dragonBones {
/**
* - The BaseObject is the base class for all objects in the DragonBones framework.
* All BaseObject instances are cached to the object pool to reduce the performance consumption of frequent requests for memory or memory recovery.
* @version DragonBones 4.5
* @language en_US
*/
/**
* - 基础对象,通常 DragonBones 的对象都继承自该类。
* 所有基础对象的实例都会缓存到对象池,以减少频繁申请内存或内存回收的性能消耗。
* @version DragonBones 4.5
* @language zh_CN
*/
abstract class BaseObject {
private static _hashCode;
private static _defaultMaxCount;
private static readonly _maxCountMap;
private static readonly _poolsMap;
private static _returnObject;
static toString(): string;
/**
* - Set the maximum cache count of the specify object pool.
* @param objectConstructor - The specify class. (Set all object pools max cache count if not set)
* @param maxCount - Max count.
* @version DragonBones 4.5
* @language en_US
*/
/**
* - 设置特定对象池的最大缓存数量。
* @param objectConstructor - 特定的类。 (不设置则设置所有对象池的最大缓存数量)
* @param maxCount - 最大缓存数量。
* @version DragonBones 4.5
* @language zh_CN
*/
static setMaxCount(objectConstructor: (typeof BaseObject) | null, maxCount: number): void;
/**
* - Clear the cached instances of a specify object pool.
* @param objectConstructor - Specify class. (Clear all cached instances if not set)
* @version DragonBones 4.5
* @language en_US
*/
/**
* - 清除特定对象池的缓存实例。
* @param objectConstructor - 特定的类。 (不设置则清除所有缓存的实例)
* @version DragonBones 4.5
* @language zh_CN
*/
static clearPool(objectConstructor?: (typeof BaseObject) | null): void;
/**
* - Get an instance of the specify class from object pool.
* @param objectConstructor - The specify class.
* @version DragonBones 4.5
* @language en_US
*/
/**
* - 从对象池中获取特定类的实例。
* @param objectConstructor - 特定的类。
* @version DragonBones 4.5
* @language zh_CN
*/
static borrowObject<T extends BaseObject>(objectConstructor: {
new (): T;
}): T;
/**
* - A unique identification number assigned to the object.
* @version DragonBones 4.5
* @language en_US
*/
/**
* - 分配给此实例的唯一标识号。
* @version DragonBones 4.5
* @language zh_CN
*/
readonly hashCode: number;
private _isInPool;
protected abstract _onClear(): void;
/**
* - Clear the object and return it back to object pool。
* @version DragonBones 4.5
* @language en_US
*/
/**
* - 清除该实例的所有数据并将其返还对象池。
* @version DragonBones 4.5
* @language zh_CN
*/
returnToPool(): void;
}
}
/**
* The MIT License (MIT)
*
* Copyright (c) 2012-2018 DragonBones team and other contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
declare namespace dragonBones {
/**
* - 2D Transform matrix.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 2D 转换矩阵。
* @version DragonBones 3.0
* @language zh_CN
*/
class Matrix {
/**
* - The value that affects the positioning of pixels along the x axis when scaling or rotating an image.
* @default 1.0
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 缩放或旋转图像时影响像素沿 x 轴定位的值。
* @default 1.0
* @version DragonBones 3.0
* @language zh_CN
*/
a: number;
/**
* - The value that affects the positioning of pixels along the y axis when rotating or skewing an image.
* @default 0.0
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 旋转或倾斜图像时影响像素沿 y 轴定位的值。
* @default 0.0
* @version DragonBones 3.0
* @language zh_CN
*/
b: number;
/**
* - The value that affects the positioning of pixels along the x axis when rotating or skewing an image.
* @default 0.0
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 旋转或倾斜图像时影响像素沿 x 轴定位的值。
* @default 0.0
* @version DragonBones 3.0
* @language zh_CN
*/
c: number;
/**
* - The value that affects the positioning of pixels along the y axis when scaling or rotating an image.
* @default 1.0
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 缩放或旋转图像时影响像素沿 y 轴定位的值。
* @default 1.0
* @version DragonBones 3.0
* @language zh_CN
*/
d: number;
/**
* - The distance by which to translate each point along the x axis.
* @default 0.0
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 沿 x 轴平移每个点的距离。
* @default 0.0
* @version DragonBones 3.0
* @language zh_CN
*/
tx: number;
/**
* - The distance by which to translate each point along the y axis.
* @default 0.0
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 沿 y 轴平移每个点的距离。
* @default 0.0
* @version DragonBones 3.0
* @language zh_CN
*/
ty: number;
/**
* @private
*/
constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number);
toString(): string;
/**
* @private
*/
copyFrom(value: Matrix): Matrix;
/**
* @private
*/
copyFromArray(value: Array<number>, offset?: number): Matrix;
/**
* - Convert to unit matrix.
* The resulting matrix has the following properties: a=1, b=0, c=0, d=1, tx=0, ty=0.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 转换为单位矩阵。
* 该矩阵具有以下属性:a=1、b=0、c=0、d=1、tx=0、ty=0。
* @version DragonBones 3.0
* @language zh_CN
*/
identity(): Matrix;
/**
* - Multiplies the current matrix with another matrix.
* @param value - The matrix that needs to be multiplied.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 将当前矩阵与另一个矩阵相乘。
* @param value - 需要相乘的矩阵。
* @version DragonBones 3.0
* @language zh_CN
*/
concat(value: Matrix): Matrix;
/**
* - Convert to inverse matrix.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 转换为逆矩阵。
* @version DragonBones 3.0
* @language zh_CN
*/
invert(): Matrix;
/**
* - Apply a matrix transformation to a specific point.
* @param x - X coordinate.
* @param y - Y coordinate.
* @param result - The point after the transformation is applied.
* @param delta - Whether to ignore tx, ty's conversion to point.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 将矩阵转换应用于特定点。
* @param x - 横坐标。
* @param y - 纵坐标。
* @param result - 应用转换之后的点。
* @param delta - 是否忽略 tx,ty 对点的转换。
* @version DragonBones 3.0
* @language zh_CN
*/
transformPoint(x: number, y: number, result: {
x: number;
y: number;
}, delta?: boolean): void;
/**
* @private
*/
transformRectangle(rectangle: {
x: number;
y: number;
width: number;
height: number;
}, delta?: boolean): void;
}
}
/**
* The MIT License (MIT)
*
* Copyright (c) 2012-2018 DragonBones team and other contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
declare namespace dragonBones {
/**
* - 2D Transform.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 2D 变换。
* @version DragonBones 3.0
* @language zh_CN
*/
class Transform {
/**
* @private
*/
static readonly PI: number;
/**
* @private
*/
static readonly PI_D: number;
/**
* @private
*/
static readonly PI_H: number;
/**
* @private
*/
static readonly PI_Q: number;
/**
* @private
*/
static readonly RAD_DEG: number;
/**
* @private
*/
static readonly DEG_RAD: number;
/**
* @private
*/
static normalizeRadian(value: number): number;
/**
* - Horizontal translate.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 水平位移。
* @version DragonBones 3.0
* @language zh_CN
*/
x: number;
/**
* - Vertical translate.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 垂直位移。
* @version DragonBones 3.0
* @language zh_CN
*/
y: number;
/**
* - Skew. (In radians)
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 倾斜。 (以弧度为单位)
* @version DragonBones 3.0
* @language zh_CN
*/
skew: number;
/**
* - rotation. (In radians)
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 旋转。 (以弧度为单位)
* @version DragonBones 3.0
* @language zh_CN
*/
rotation: number;
/**
* - Horizontal Scaling.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 水平缩放。
* @version DragonBones 3.0
* @language zh_CN
*/
scaleX: number;
/**
* - Vertical scaling.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 垂直缩放。
* @version DragonBones 3.0
* @language zh_CN
*/
scaleY: number;
/**
* @private
*/
constructor(x?: number, y?: number, skew?: number, rotation?: number, scaleX?: number, scaleY?: number);
toString(): string;
/**
* @private
*/
copyFrom(value: Transform): Transform;
/**
* @private
*/
identity(): Transform;
/**
* @private
*/
add(value: Transform): Transform;
/**
* @private
*/
minus(value: Transform): Transform;
/**
* @private
*/
fromMatrix(matrix: Matrix): Transform;
/**
* @private
*/
toMatrix(matrix: Matrix): Transform;
}
}
/**
* The MIT License (MIT)
*
* Copyright (c) 2012-2018 DragonBones team and other contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
declare namespace dragonBones {
/**
* @private
*/
class ColorTransform {
alphaMultiplier: number;
redMultiplier: number;
greenMultiplier: number;
blueMultiplier: number;
alphaOffset: number;
redOffset: number;
greenOffset: number;
blueOffset: number;
constructor(alphaMultiplier?: number, redMultiplier?: number, greenMultiplier?: number, blueMultiplier?: number, alphaOffset?: number, redOffset?: number, greenOffset?: number, blueOffset?: number);
copyFrom(value: ColorTransform): void;
identity(): void;
}
}
/**
* The MIT License (MIT)
*
* Copyright (c) 2012-2018 DragonBones team and other contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
declare namespace dragonBones {
/**
* - The Point object represents a location in a two-dimensional coordinate system.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - Point 对象表示二维坐标系统中的某个位置。
* @version DragonBones 3.0
* @language zh_CN
*/
class Point {
/**
* - The horizontal coordinate.
* @default 0.0
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 该点的水平坐标。
* @default 0.0
* @version DragonBones 3.0
* @language zh_CN
*/
x: number;
/**
* - The vertical coordinate.
* @default 0.0
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 该点的垂直坐标。
* @default 0.0
* @version DragonBones 3.0
* @language zh_CN
*/
y: number;
/**
* - Creates a new point. If you pass no parameters to this method, a point is created at (0,0).
* @param x - The horizontal coordinate.
* @param y - The vertical coordinate.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 创建一个 egret.Point 对象.若不传入任何参数,将会创建一个位于(0,0)位置的点。
* @param x - 该对象的x属性值,默认为 0.0。
* @param y - 该对象的y属性值,默认为 0.0。
* @version DragonBones 3.0
* @language zh_CN
*/
constructor(x?: number, y?: number);
/**
* @private
*/
copyFrom(value: Point): void;
/**
* @private
*/
clear(): void;
}
}
/**
* The MIT License (MIT)
*
* Copyright (c) 2012-2018 DragonBones team and other contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
declare namespace dragonBones {
/**
* - A Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its
* width and its height.<br/>
* The x, y, width, and height properties of the Rectangle class are independent of each other; changing the value of
* one property has no effect on the others. However, the right and bottom properties are integrally related to those
* four properties. For example, if you change the value of the right property, the value of the width property changes;
* if you change the bottom property, the value of the height property changes.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - Rectangle 对象是按其位置(由它左上角的点 (x, y) 确定)以及宽度和高度定义的区域。<br/>
* Rectangle 类的 x、y、width 和 height 属性相互独立;更改一个属性的值不会影响其他属性。
* 但是,right 和 bottom 属性与这四个属性是整体相关的。例如,如果更改 right 属性的值,则 width
* 属性的值将发生变化;如果更改 bottom 属性,则 height 属性的值将发生变化。
* @version DragonBones 3.0
* @language zh_CN
*/
class Rectangle {
/**
* - The x coordinate of the top-left corner of the rectangle.
* @default 0.0
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 矩形左上角的 x 坐标。
* @default 0.0
* @version DragonBones 3.0
* @language zh_CN
*/
x: number;
/**
* - The y coordinate of the top-left corner of the rectangle.
* @default 0.0
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 矩形左上角的 y 坐标。
* @default 0.0
* @version DragonBones 3.0
* @language zh_CN
*/
y: number;
/**
* - The width of the rectangle, in pixels.
* @default 0.0
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 矩形的宽度(以像素为单位)。
* @default 0.0
* @version DragonBones 3.0
* @language zh_CN
*/
width: number;
/**
* - 矩形的高度(以像素为单位)。
* @default 0.0
* @version DragonBones 3.0
* @language en_US
*/
/**
* - The height of the rectangle, in pixels.
* @default 0.0
* @version DragonBones 3.0
* @language zh_CN
*/
height: number;
/**
* @private
*/
constructor(x?: number, y?: number, width?: number, height?: number);
/**
* @private
*/
copyFrom(value: Rectangle): void;
/**
* @private
*/
clear(): void;
}
}
/**
* The MIT License (MIT)
*
* Copyright (c) 2012-2018 DragonBones team and other contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
declare namespace dragonBones {
/**
* - The user custom data.
* @version DragonBones 5.0
* @language en_US
*/
/**
* - 用户自定义数据。
* @version DragonBones 5.0
* @language zh_CN
*/
class UserData extends BaseObject {
static toString(): string;
/**
* - The custom int numbers.
* @version DragonBones 5.0
* @language en_US
*/
/**
* - 自定义整数。
* @version DragonBones 5.0
* @language zh_CN
*/
readonly ints: Array<number>;
/**
* - The custom float numbers.
* @version DragonBones 5.0
* @language en_US
*/
/**
* - 自定义浮点数。
* @version DragonBones 5.0
* @language zh_CN
*/
readonly floats: Array<number>;
/**
* - The custom strings.
* @version DragonBones 5.0
* @language en_US
*/
/**
* - 自定义字符串。
* @version DragonBones 5.0
* @language zh_CN
*/
readonly strings: Array<string>;
protected _onClear(): void;
/**
* - Get the custom int number.
* @version DragonBones 5.0
* @language en_US
*/
/**
* - 获取自定义整数。
* @version DragonBones 5.0
* @language zh_CN
*/
getInt(index?: number): number;
/**
* - Get the custom float number.
* @version DragonBones 5.0
* @language en_US
*/
/**
* - 获取自定义浮点数。
* @version DragonBones 5.0
* @language zh_CN
*/
getFloat(index?: number): number;
/**
* - Get the custom string.
* @version DragonBones 5.0
* @language en_US
*/
/**
* - 获取自定义字符串。
* @version DragonBones 5.0
* @language zh_CN
*/
getString(index?: number): string;
}
/**
* @private
*/
class ActionData extends BaseObject {
static toString(): string;
type: ActionType;
name: string;
bone: BoneData | null;
slot: SlotData | null;
data: UserData | null;
protected _onClear(): void;
}
}
/**
* The MIT License (MIT)
*
* Copyright (c) 2012-2018 DragonBones team and other contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
declare namespace dragonBones {
/**
* - The DragonBones data.
* A DragonBones data contains multiple armature data.
* @see dragonBones.ArmatureData
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 龙骨数据。
* 一个龙骨数据包含多个骨架数据。
* @see dragonBones.ArmatureData
* @version DragonBones 3.0
* @language zh_CN
*/
class DragonBonesData extends BaseObject {
static toString(): string;
/**
* @private
*/
autoSearch: boolean;
/**
* - The animation frame rate.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 动画帧频。
* @version DragonBones 3.0
* @language zh_CN
*/
frameRate: number;
/**
* - The data version.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 数据版本。
* @version DragonBones 3.0
* @language zh_CN
*/
version: string;
/**
* - The DragonBones data name.
* The name is consistent with the DragonBones project name.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 龙骨数据名称。
* 该名称与龙骨项目名保持一致。
* @version DragonBones 3.0
* @language zh_CN
*/
name: string;
/**
* @private
*/
stage: ArmatureData | null;
/**
* - All armature data names.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 所有的骨架数据名称。
* @version DragonBones 3.0
* @language zh_CN
*/
readonly armatureNames: Array<string>;
/**
* @private
*/
readonly armatures: Map<ArmatureData>;
/**
* @private
*/
userData: UserData | null;
protected _onClear(): void;
/**
* - Get a specific armature data.
* @param armatureName - The armature data name.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 获取特定的骨架数据。
* @param armatureName - 骨架数据名称。
* @version DragonBones 3.0
* @language zh_CN
*/
getArmature(armatureName: string): ArmatureData | null;
}
}
/**
* The MIT License (MIT)
*
* Copyright (c) 2012-2018 DragonBones team and other contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
declare namespace dragonBones {
/**
* - The armature data.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 骨架数据。
* @version DragonBones 3.0
* @language zh_CN
*/
class ArmatureData extends BaseObject {
static toString(): string;
/**
* @private
*/
type: ArmatureType;
/**
* - The animation frame rate.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 动画帧率。
* @version DragonBones 3.0
* @language zh_CN
*/
frameRate: number;
/**
* @private
*/
cacheFrameRate: number;
/**
* @private
*/
scale: number;
/**
* - The armature name.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 骨架名称。
* @version DragonBones 3.0
* @language zh_CN
*/
name: string;
/**
* @private
*/
readonly aabb: Rectangle;
/**
* - The names of all the animation data.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 所有的动画数据名称。
* @version DragonBones 3.0
* @language zh_CN
*/
readonly animationNames: Array<string>;
/**
* @private
*/
readonly sortedBones: Array<BoneData>;
/**
* @private
*/
readonly sortedSlots: Array<SlotData>;
/**
* @private
*/
readonly defaultActions: Array<ActionData>;
/**
* @private
*/
readonly actions: Array<ActionData>;
/**
* @private
*/
readonly bones: Map<BoneData>;
/**
* @private
*/
readonly slots: Map<SlotData>;
/**
* @private
*/
readonly constraints: Map<ConstraintData>;
/**
* @private
*/
readonly skins: Map<SkinData>;
/**
* @private
*/
readonly animations: Map<AnimationData>;
/**
* - The default skin data.
* @version DragonBones 4.5
* @language en_US
*/
/**
* - 默认插槽数据。
* @version DragonBones 4.5
* @language zh_CN
*/
defaultSkin: SkinData | null;
/**
* - The default animation data.
* @version DragonBones 4.5
* @language en_US
*/
/**
* - 默认动画数据。
* @version DragonBones 4.5
* @language zh_CN
*/
defaultAnimation: AnimationData | null;
/**
* @private
*/
canvas: CanvasData | null;
/**
* @private
*/
userData: UserData | null;
/**
* @private
*/
parent: DragonBonesData;
protected _onClear(): void;
/**
* - Get a specific done data.
* @param boneName - The bone name.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 获取特定的骨骼数据。
* @param boneName - 骨骼名称。
* @version DragonBones 3.0
* @language zh_CN
*/
getBone(boneName: string): BoneData | null;
/**
* - Get a specific slot data.
* @param slotName - The slot name.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 获取特定的插槽数据。
* @param slotName - 插槽名称。
* @version DragonBones 3.0
* @language zh_CN
*/
getSlot(slotName: string): SlotData | null;
/**
* @private
*/
getConstraint(constraintName: string): ConstraintData | null;
/**
* - Get a specific skin data.
* @param skinName - The skin name.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 获取特定皮肤数据。
* @param skinName - 皮肤名称。
* @version DragonBones 3.0
* @language zh_CN
*/
getSkin(skinName: string): SkinData | null;
/**
* @private
*/
getMesh(skinName: string, slotName: string, meshName: string): MeshDisplayData | null;
/**
* - Get a specific animation data.
* @param animationName - The animation animationName.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 获取特定的动画数据。
* @param animationName - 动画名称。
* @version DragonBones 3.0
* @language zh_CN
*/
getAnimation(animationName: string): AnimationData | null;
}
/**
* - The bone data.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 骨骼数据。
* @version DragonBones 3.0
* @language zh_CN
*/
class BoneData extends BaseObject {
static toString(): string;
/**
* @private
*/
inheritTranslation: boolean;
/**
* @private
*/
inheritRotation: boolean;
/**
* @private
*/
inheritScale: boolean;
/**
* @private
*/
inheritReflection: boolean;
/**
* @private
*/
type: BoneType;
/**
* - The bone length.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 骨骼长度。
* @version DragonBones 3.0
* @language zh_CN
*/
length: number;
/**
* @private
*/
alpha: number;
/**
* - The bone name.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 骨骼名称。
* @version DragonBones 3.0
* @language zh_CN
*/
name: string;
/**
* @private
*/
readonly transform: Transform;
/**
* @private
*/
userData: UserData | null;
/**
* - The parent bone data.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 父骨骼数据。
* @version DragonBones 3.0
* @language zh_CN
*/
parent: BoneData | null;
protected _onClear(): void;
}
/**
* - The slot data.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 插槽数据。
* @version DragonBones 3.0
* @language zh_CN
*/
class SlotData extends BaseObject {
static toString(): string;
/**
* @private
*/
blendMode: BlendMode;
/**
* @private
*/
displayIndex: number;
/**
* @private
*/
zOrder: number;
/**
* @private
*/
zIndex: number;
/**
* @private
*/
alpha: number;
/**
* - The slot name.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 插槽名称。
* @version DragonBones 3.0
* @language zh_CN
*/
name: string;
/**
* @private
*/
color: ColorTransform;
/**
* @private
*/
userData: UserData | null;
/**
* - The parent bone data.
* @version DragonBones 3.0
* @language en_US
*/
/**
* - 父骨骼数据。
* @version DragonBones 3.0
* @language zh_CN
*/
parent: BoneData;
protected _onClear(): void;
}
}
/**
* The MIT License (MIT)
*
* Copyright (c) 2012-2018 DragonBones team and other contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
declare namespace dragonBones {
/**
* @private
*/
abstract class ConstraintData extends BaseObject {
order: number;
name: string;
type: ConstraintType;
target: BoneData;
root: BoneData;
bone: BoneData | null;
protected _onClear(): void;
}
}
/**
* The MIT License (MIT)
*
* Copyright (c) 2012-2018 DragonBones team and other contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILI