{"_id":"@brulogaz/pixi-viewport","_rev":"2-bd89bbec6b20cd4b9dca8ec94c8c64c3","name":"@brulogaz/pixi-viewport","dist-tags":{"latest":"1.4.1"},"versions":{"1.4.1":{"name":"@brulogaz/pixi-viewport","version":"1.4.1","description":"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.","main":"dist/viewport.js","directories":{"doc":"docs"},"scripts":{"test":"budo docs/code.js:index.js --dir docs --live","build-demo":"browserify docs/code.js -o docs/index.js","docs":"jsdoc -c .jsdoc.json","transpile":"babel src/ --out-dir dist --source-maps inline","prepublishOnly":"npm run transpile"},"repository":{"type":"git","url":"git+https://github.com/brulogaz/pixi-viewport.git"},"keywords":["PIXI","pixi.js","viewport","zoom","scroll","pinch","stage","bounce","decelerate"],"author":{"name":"David Figatner"},"license":"MIT","bugs":{"url":"https://github.com/brulogaz/pixi-viewport/issues"},"homepage":"https://github.com/brulogaz/pixi-viewport#readme","peerDependencies":{"pixi.js":">=4.6.0"},"dependencies":{"eventemitter3":"^3.0.0","exists":"^1.0.1","pixi-ease":">=0.14.3"},"devDependencies":{"babel-cli":"^6.26.0","babel-preset-env":"^1.6.1","browserify":"^15.2.0","budo":"^10.0.4","clicked":"^1.3.0","fork-me-github":"^1.0.3","highlight.js":"^9.12.0","jsdoc":"^3.5.5","pixi.js":"^4.7.0","yy-counter":"^2.1.0","yy-fps":"^0.6.0","yy-jsdoc-template":"^1.3.0","yy-random":"^1.6.0"},"gitHead":"277ea1ac565c3da761f0adba80072810b1f97700","_id":"@brulogaz/pixi-viewport@1.4.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"brulogaz","email":"brulopropane@gmail.com"},"dist":{"integrity":"sha512-QPlm9InOOX10D+pVHjE6c8uQdoShxuM3u4F+bECVskkXAzV4T1oOKu/6gwKmIPxoayG8ILnr8HmVzydZynxlhw==","shasum":"3252cc90b9c0c9452837fbf3eaaf446f713ecf96","tarball":"https://registry.npmjs.org/@brulogaz/pixi-viewport/-/pixi-viewport-1.4.1.tgz","fileCount":18,"unpackedSize":311226,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqeV5v/Nm94e+eKLkl1NHuhzpTtN4Ukzn5bpLdAAeb/gIgCEpX03r7YZ/bYwOsGKaaQfA5y1Zk4Eh1Ae7M4PKCqtU="}]},"maintainers":[{"name":"brulogaz","email":"brulopropane@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pixi-viewport_1.4.1_1522239577203_0.9745650269715147"},"_hasShrinkwrap":false}},"time":{"created":"2018-03-28T12:19:37.154Z","1.4.1":"2018-03-28T12:19:37.305Z","modified":"2022-04-04T20:49:15.055Z"},"maintainers":[{"name":"brulogaz","email":"brulopropane@gmail.com"}],"description":"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.","homepage":"https://github.com/brulogaz/pixi-viewport#readme","keywords":["PIXI","pixi.js","viewport","zoom","scroll","pinch","stage","bounce","decelerate"],"repository":{"type":"git","url":"git+https://github.com/brulogaz/pixi-viewport.git"},"author":{"name":"David Figatner"},"bugs":{"url":"https://github.com/brulogaz/pixi-viewport/issues"},"license":"MIT","readme":"# pixi-viewport\r\nA highly configurable viewport/2D camera designed to work with pixi.js.\r\n\r\nFeatures 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. See live example to try out all of these features.\r\n\r\nAll features are configurable and removable, so set up the viewport to be exactly what you need.\r\n\r\n## Rationale\r\nI kept rewriting 2d cameras for the games I developed with pixi.js, so I decided to package up a generic one. I included options that I need in my games, including edges that bounce, deceleration, and lots of options to tweak the feel of the viewport. \r\n\r\n## Simple Example\r\n```js\r\nvar PIXI = require('pixi.js');\r\nvar Viewport = require('pixi-viewport');\r\n\r\n// create viewport\r\nvar viewport = new Viewport({\r\n    screenWidth: window.innerWidth,\r\n    screenHeight: window.innerHeight,\r\n    worldWidth: 1000,\r\n    worldHeight: 1000\r\n});\r\n\r\n// add the viewport to the stage\r\nvar app = new PIXI.Application();\r\ndocument.body.appendChild(app.view);\r\napp.stage.addChild(viewport);\r\n\r\n// activate plugins\r\nviewport\r\n    .drag()\r\n    .pinch()\r\n    .decelerate();\r\n\r\n// add a red box\r\nvar sprite = viewport.addChild(new PIXI.Sprite(PIXI.Texture.WHITE));\r\nsprite.tint = 0xff0000;\r\nsprite.width = sprite.height = 100\r\nsprite.position.set(100, 100);\r\n```\r\n\r\n## Live Example\r\n[https://davidfig.github.io/pixi-viewport/](https://davidfig.github.io/pixi-viewport/)\r\n\r\n## API Documentation\r\n[https://davidfig.github.io/pixi-viewport/jsdoc/](https://davidfig.github.io/pixi-viewport/jsdoc/)\r\n\r\n## Installation\r\n\r\n    npm i pixi-viewport\r\n\r\n## license  \r\nMIT License  \r\n(c) 2018 [YOPEY YOPEY LLC](https://yopeyopey.com/) by [David Figatner](https://twitter.com/yopey_yopey/)\r\n","readmeFilename":"README.md"}