40 lines
879 B
TypeScript
40 lines
879 B
TypeScript
|
import { Container, IPointData, Point } from 'pixi.js';
|
||
|
export interface IDashedLineOptions {
|
||
|
/**
|
||
|
* 每小段长度,默认4
|
||
|
*/
|
||
|
length?: number;
|
||
|
/**
|
||
|
* 起始间隔,默认0
|
||
|
*/
|
||
|
startSpace?: number;
|
||
|
/**
|
||
|
* 间隔长度,默认4
|
||
|
*/
|
||
|
space?: number;
|
||
|
/**
|
||
|
* 线宽,默认1
|
||
|
*/
|
||
|
lineWidth?: number;
|
||
|
/**
|
||
|
* 线色,默认黑
|
||
|
*/
|
||
|
color?: string;
|
||
|
}
|
||
|
interface ICompleteDashedLineOptions extends IDashedLineOptions {
|
||
|
length: number;
|
||
|
startSpace: number;
|
||
|
space: number;
|
||
|
lineWidth: number;
|
||
|
color: string;
|
||
|
}
|
||
|
export declare class DashedLine extends Container {
|
||
|
p1: Point;
|
||
|
p2: Point;
|
||
|
_options: ICompleteDashedLineOptions;
|
||
|
constructor(p1: IPointData, p2: IPointData, options?: IDashedLineOptions);
|
||
|
setOptions(options: IDashedLineOptions): void;
|
||
|
redraw(): void;
|
||
|
}
|
||
|
export {};
|