Skip to content

ca-la/pixi-viewport-gesture-pinch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A pixi-viewport plugin to support pinch-to-zoom with the nonstandard GestureEvent API (e.g. on Safari)

Resources

License

Stars

Watchers

Forks

Packages

No packages published