1.1.0 • Published 5 years ago

pixi-viewport-gesture-pinch v1.1.0

Weekly downloads
118
License
MIT
Repository
github
Last release
5 years ago

pixi-viewport-gesture-pinch

A plugin for pixi-viewport allowing pinch-to-zoom behavior with the non-standard GestureEvent API. Though this isn't on a standards track, it's necessary to support pinch to zoom behavior on certain browsers (Safari).

Usage

import { Viewport } from 'pixi-viewport';
import GesturePinch from 'pixi-viewport-gesture-pinch';

const viewport = new Viewport(options);
viewport.pinch();

const gesturePinch = new GesturePinch({ viewport });
viewport.plugins.add('gesture-pinch', gesturePinch);

Notes

If you're developing locally, you may want to npm link this module into your project:

$ npm link --only=production /path/to/pixi-viewport-gesture-pinch

If you're using TypeScript, due to issues with module resolution for npm linked type definitions you'll need to make sure your build system preserves symlinks. In Webpack, set resolve.symlinks to false. In a tsconfig file, set compilerOptions.preserveSymlinks to true