graphic-pixi/lib/plugins/CommonMousePlugin.d.ts

83 lines
2.3 KiB
TypeScript
Raw Normal View History

2023-12-12 17:31:07 +08:00
import { DisplayObject, FederatedMouseEvent, Graphics, Point } from 'pixi.js';
import { IGraphicScene } from '../app';
import { JlGraphic } from '../core';
import { AppDragEvent, AppInteractionPlugin } from './InteractionPlugin';
type GraphicSelectFilter = (graphic: JlGraphic) => boolean;
export interface IMouseToolOptions {
/**
* ,
*/
boxSelect?: boolean;
/**
* (),
*/
viewportDrag?: boolean;
/**
*
*/
viewportDragLeft?: boolean;
/**
* ,
*/
wheelZoom?: boolean;
/**
*
*/
selectFilter?: GraphicSelectFilter;
}
declare class CompleteMouseToolOptions implements IMouseToolOptions {
boxSelect: boolean;
viewportDrag: boolean;
viewportDragLeft: boolean;
wheelZoom: boolean;
selectFilter?: GraphicSelectFilter | undefined;
constructor();
update(options: IMouseToolOptions): void;
}
/**
*
*/
export declare class CommonMouseTool extends AppInteractionPlugin {
static Name: string;
static SelectBox: string;
options: CompleteMouseToolOptions;
box: Graphics;
leftDownTarget: DisplayObject | null;
drag: boolean;
graphicSelect: boolean;
rightTarget: DisplayObject | null;
constructor(scene: IGraphicScene);
static new(app: IGraphicScene): CommonMouseTool;
bind(): void;
unbind(): void;
onDragStart(event: AppDragEvent): void;
onDragMove(event: AppDragEvent): void;
onDragEnd(event: AppDragEvent): void;
setLeftCursor(e: FederatedMouseEvent): void;
resumeLeftCursor(): void;
setCursor(e: FederatedMouseEvent): void;
resumeCursor(): void;
onMouseDown(e: FederatedMouseEvent): void;
/**
*
* @param e
*/
onMouseUp(e: FederatedMouseEvent): void;
/**
*
*/
clearCache(): void;
get boxSelect(): boolean | undefined;
get selectFilter(): GraphicSelectFilter | undefined;
/**
*
*/
boxSelectDraw(start: Point, end: Point): void;
/**
*
* @returns
*/
boxSelectGraphicCheck(): void;
}
export {};
2023-12-13 13:59:09 +08:00
//# sourceMappingURL=CommonMousePlugin.d.ts.map