UNPKG

@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.

28 lines (27 loc) 834 B
import { Plugin } from './Plugin'; import type { Viewport } from '../Viewport'; export interface IClampOptions { left?: number | boolean | null; top?: number | boolean | null; right?: number | boolean | null; bottom?: number | boolean | null; direction?: 'all' | 'x' | 'y' | null; underflow?: 'center' | string; } export declare class Clamp extends Plugin { readonly options: Required<IClampOptions>; protected last: { x: number | null; y: number | null; scaleX: number | null; scaleY: number | null; }; protected noUnderflow: boolean; protected underflowX: -1 | 0 | 1; protected underflowY: -1 | 0 | 1; constructor(parent: Viewport, options?: IClampOptions); private parseUnderflow; move(): boolean; update(): void; reset(): void; }