graphic-pixi/lib/graphic/AbsorbablePosition.d.ts

92 lines
2.5 KiB
TypeScript
Raw Normal View History

2023-12-12 17:31:07 +08:00
import { Container, DisplayObject, Graphics, IPointData, Point } from 'pixi.js';
import { VectorGraphic } from './VectorGraphic';
/**
*
*/
export interface AbsorbablePosition extends Container {
/**
* ()
* @param other
*/
isOverlapping(other: AbsorbablePosition): boolean;
/**
*
* @param other
* @returns >0<0另一个吸附范围大=0两个吸附范围一样大
*/
compareTo(other: AbsorbablePosition): number;
/**
*
* @param objs
* @returns truefalse
*/
tryAbsorb(...objs: DisplayObject[]): void;
}
/**
*
*/
export declare const AbsorbablePointParam: {
lineWidth: number;
lineColor: string;
fillColor: string;
radius: number;
};
/**
*
*/
2023-12-14 13:46:28 +08:00
export declare class AbsorbablePoint extends Graphics implements AbsorbablePosition, VectorGraphic {
2023-12-12 17:31:07 +08:00
_point: Point;
absorbRange: number;
scaledListenerOn: boolean;
/**
*
* @param point
* @param absorbRange
*/
constructor(point: IPointData, absorbRange?: number);
compareTo(other: AbsorbablePosition): number;
isOverlapping(other: AbsorbablePosition): boolean;
tryAbsorb(...objs: DisplayObject[]): void;
updateOnScaled(): void;
}
/**
* 线
*/
export declare class AbsorbableLine extends Graphics implements AbsorbablePosition {
p1: Point;
p2: Point;
absorbRange: number;
_color: string;
/**
*
* @param p1
* @param p2
* @param absorbRange
*/
constructor(p1: IPointData, p2: IPointData, absorbRange?: number);
isOverlapping(other: AbsorbablePosition): boolean;
compareTo(other: AbsorbablePosition): number;
redraw(): void;
tryAbsorb(...objs: DisplayObject[]): void;
}
/**
*
*/
export declare class AbsorbableCircle extends Graphics implements AbsorbablePosition {
absorbRange: number;
p0: Point;
radius: number;
_color: string;
/**
*
* @param p
* @param radius
* @param absorbRange
*/
constructor(p: IPointData, radius: number, absorbRange?: number);
isOverlapping(other: AbsorbablePosition): boolean;
compareTo(other: AbsorbablePosition): number;
redraw(): void;
tryAbsorb(...objs: DisplayObject[]): void;
}