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.
16 lines (15 loc) • 519 B
TypeScript
import { Plugin } from './Plugin';
import type { Container, PointData } from 'pixi.js';
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: Container;
protected velocity: PointData;
constructor(parent: Viewport, target: Container, options?: IFollowOptions);
update(elapsed: number): void;
}