pixi-dragonbones-runtime
Version:
DragonBones Runtime for Pixi.js
225 lines (224 loc) • 6.25 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.
*/
import { BaseObject, BoundingBoxType } from "../core/index.js";
/**
* [en] The base class of bounding box data.
*
* [zh] 边界框数据基类。
*
* @see RectangleData
* @see EllipseData
* @see PolygonData
* @version DragonBones 5.0
*/
export declare abstract class BoundingBoxData extends BaseObject {
/**
* [en] The bounding box type.
*
* [zh] 边界框类型。
*
* @version DragonBones 5.0
*/
type: BoundingBoxType;
/**
* @private
*/
color: number;
/**
* @private
*/
width: number;
/**
* @private
*/
height: number;
protected _onClear(): void;
/**
* [en] Check whether the bounding box contains a specific point. (Local coordinate system)
*
* [zh] 检查边界框是否包含特定点。(本地坐标系)
*
* @version DragonBones 5.0
*/
abstract containsPoint(pX: number, pY: number): boolean;
/**
* [en] Check whether the bounding box intersects a specific segment. (Local coordinate system)
*
* [zh] 检查边界框是否与特定线段相交。(本地坐标系)
*
* @version DragonBones 5.0
*/
abstract intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA: {
x: number;
y: number;
} | null, intersectionPointB: {
x: number;
y: number;
} | null, normalRadians: {
x: number;
y: number;
} | null): number;
}
/**
* [en] The rectangle bounding box data.
*
* [zh] 矩形边界框数据。
*
* @version DragonBones 5.1
*/
export declare class RectangleBoundingBoxData extends BoundingBoxData {
static toString(): string;
/**
* - Compute the bit code for a point (x, y) using the clip rectangle
*/
private static _computeOutCode;
/**
* @private
*/
static rectangleIntersectsSegment(xA: number, yA: number, xB: number, yB: number, xMin: number, yMin: number, xMax: number, yMax: number, intersectionPointA?: {
x: number;
y: number;
} | null, intersectionPointB?: {
x: number;
y: number;
} | null, normalRadians?: {
x: number;
y: number;
} | null): number;
protected _onClear(): void;
/**
* @inheritDoc
*/
containsPoint(pX: number, pY: number): boolean;
/**
* @inheritDoc
*/
intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: {
x: number;
y: number;
} | null, intersectionPointB?: {
x: number;
y: number;
} | null, normalRadians?: {
x: number;
y: number;
} | null): number;
}
/**
* [en] The ellipse bounding box data.
*
* [zh] 椭圆边界框数据。
*
* @version DragonBones 5.1
*/
export declare class EllipseBoundingBoxData extends BoundingBoxData {
static toString(): string;
/**
* @private
*/
static ellipseIntersectsSegment(xA: number, yA: number, xB: number, yB: number, xC: number, yC: number, widthH: number, heightH: number, intersectionPointA?: {
x: number;
y: number;
} | null, intersectionPointB?: {
x: number;
y: number;
} | null, normalRadians?: {
x: number;
y: number;
} | null): number;
protected _onClear(): void;
/**
* @inheritDoc
*/
containsPoint(pX: number, pY: number): boolean;
/**
* @inheritDoc
*/
intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: {
x: number;
y: number;
} | null, intersectionPointB?: {
x: number;
y: number;
} | null, normalRadians?: {
x: number;
y: number;
} | null): number;
}
/**
* [en] The polygon bounding box data.
*
* [zh] 多边形边界框数据。
*
* @version DragonBones 5.1
*/
export declare class PolygonBoundingBoxData extends BoundingBoxData {
static toString(): string;
/**
* @private
*/
static polygonIntersectsSegment(xA: number, yA: number, xB: number, yB: number, vertices: Array<number>, intersectionPointA?: {
x: number;
y: number;
} | null, intersectionPointB?: {
x: number;
y: number;
} | null, normalRadians?: {
x: number;
y: number;
} | null): number;
/**
* @private
*/
x: number;
/**
* @private
*/
y: number;
/**
* [en] The polygon vertices.
*
* [zh] 多边形顶点。
*
* @version DragonBones 5.1
*/
readonly vertices: Array<number>;
protected _onClear(): void;
/**
* @inheritDoc
*/
containsPoint(pX: number, pY: number): boolean;
/**
* @inheritDoc
*/
intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: {
x: number;
y: number;
} | null, intersectionPointB?: {
x: number;
y: number;
} | null, normalRadians?: {
x: number;
y: number;
} | null): number;
}