UNPKG

pixi-dragonbones-runtime

Version:
160 lines (159 loc) 4.95 kB
/** * 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. */ /** * [en] 2D Transform matrix. * * [zh] 2D 转换矩阵。 * * @version DragonBones 3.0 */ export declare class Matrix { /** * [en] The value that affects the positioning of pixels along the x axis when scaling or rotating an image. * * [zh] 缩放或旋转图像时影响像素沿 x 轴定位的值。 * * @default 1.0 * @version DragonBones 3.0 */ a: number; /** * [en] The value that affects the positioning of pixels along the y axis when rotating or skewing an image. * * [zh] 旋转或倾斜图像时影响像素沿 y 轴定位的值。 * * @default 0.0 * @version DragonBones 3.0 */ b: number; /** * [en] The value that affects the positioning of pixels along the x axis when rotating or skewing an image. * * [zh] 旋转或倾斜图像时影响像素沿 x 轴定位的值。 * * @default 0.0 * @version DragonBones 3.0 */ c: number; /** * [en] The value that affects the positioning of pixels along the y axis when scaling or rotating an image. * * [zh] 缩放或旋转图像时影响像素沿 y 轴定位的值。 * * @default 1.0 * @version DragonBones 3.0 */ d: number; /** * [en] The distance by which to translate each point along the x axis. * * [zh] 沿 x 轴平移每个点的距离。 * * @default 0.0 * @version DragonBones 3.0 */ tx: number; /** * [en] The distance by which to translate each point along the y axis. * * [zh] 沿 y 轴平移每个点的距离。 * * @default 0.0 * @version DragonBones 3.0 */ 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; /** * [en] Convert to unit matrix. * The resulting matrix has the following properties: a=1, b=0, c=0, d=1, tx=0, ty=0. * * [zh] 转换为单位矩阵。 * 该矩阵具有以下属性:a=1、b=0、c=0、d=1、tx=0、ty=0。 * * @version DragonBones 3.0 */ identity(): Matrix; /** * [en] Multiplies the current matrix with another matrix. * * [zh] 将当前矩阵与另一个矩阵相乘。 * * @param value - [en] The matrix that needs to be multiplied. * @param value - [zh] 需要相乘的矩阵。 * * @version DragonBones 3.0 */ concat(value: Matrix): Matrix; /** * [en] Convert to inverse matrix. * * [zh] 转换为逆矩阵。 * * @version DragonBones 3.0 */ invert(): Matrix; /** * [en] Apply a matrix transformation to a specific point. * * [zh] 将矩阵转换应用于特定点。 * * @param x - [en] X coordinate. * @param x - [zh] 横坐标。 * * @param y - [en] Y coordinate. * @param y - [zh] 纵坐标。 * * @param result - [en] The point after the transformation is applied. * @param result - [zh] 应用转换之后的点。 * * @param delta - [en] Whether to ignore tx, ty's conversion to point. * @param delta - [zh] 是否忽略 tx,ty 对点的转换。 * * @version DragonBones 3.0 */ 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; }