@ahmafi/pixi-viewport
Version:
A highly configurable viewport/2D camera designed to work with pixi.js. Features include dragging, pinch-to-zoom, mouse wheel zooming, decelerated dragging, follow target, snap to point, snap to zoom, clamping, bouncing on edges, and move on mouse edges.
17 lines (16 loc) • 573 B
TypeScript
import { Plugin } from './Plugin';
import type { DisplayObject } from '@pixi/display';
import type { IPointData } from '@pixi/core';
import type { Viewport } from '../Viewport';
export interface IFollowOptions {
speed?: number;
acceleration?: number | null;
radius?: number | null;
}
export declare class Follow extends Plugin {
readonly options: Required<IFollowOptions>;
target: DisplayObject;
protected velocity: IPointData;
constructor(parent: Viewport, target: DisplayObject, options?: IFollowOptions);
update(elapsed: number): void;
}