Socket
Socket
Sign inDemoInstall

pixi-viewport

Package Overview
Dependencies
Maintainers
1
Versions
243
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pixi-viewport - npm Package Compare versions

Comparing version 0.7.4 to 0.7.6

4

package.json
{
"name": "pixi-viewport",
"version": "0.7.4",
"version": "0.7.6",
"description": "A highly configurable viewport/2D camera designed to work with pixi.js. Featurse inclue dragging, pinch-to-zoom, decelerated dragging, following target, snapping to point, clamping, bouncing on edges.",

@@ -13,3 +13,3 @@ "main": "index.js",

"docs": "markdown-api README.md src/viewport.js",
"prepare": "npm run build && npm run docs"
"prepare": "yarn run build && yarn run docs"
},

@@ -16,0 +16,0 @@ "repository": {

@@ -72,7 +72,7 @@ # pixi-viewport

/**
* use this to set screen and world sizes--needed for most plugins
* use this to set screen and world sizes--needed for pinch/wheel/clamp/bounce
* @param {number} screenWidth
* @param {number} screenHeight
* @param {number} worldWidth
* @param {number} worldHeight
* @param {number} [worldWidth]
* @param {number} [worldHeight]
*/

@@ -103,3 +103,3 @@ resize(screenWidth, screenHeight, worldWidth, worldHeight)

/**
* @type {number} screen width in world coordinates
* @type {number} screen height in world coordinates
*/

@@ -118,2 +118,3 @@ get worldScreenHeight()

* @param {number} [y]
* @return {Viewport} this
*/

@@ -132,2 +133,3 @@ moveCenter(/*x, y | PIXI.Point*/)

* @param {number} y
* @return {Viewport} this
*/

@@ -139,3 +141,4 @@ moveCorner(/*x, y | point*/)

* @param {number} [width=container.width] in world coordinates; uses container.width if not provided
* @param {boolean} [center] maintain the same center
* @param {boolean} [center] maintain the same center
* @return {Viewport} this
*/

@@ -147,3 +150,4 @@ fitWidth(width, center)

* @param {number} [width=container.height] in world coordinates; uses container.width if not provided
* @param {boolean} [center] maintain the same center of the screen after zoom
* @param {boolean} [center] maintain the same center of the screen after zoom
* @return {Viewport} this
*/

@@ -155,2 +159,3 @@ fitHeight(height, center)

* @param {boolean} [center] maintain the same center of the screen after zoom
* @return {Viewport} this
*/

@@ -160,8 +165,2 @@ fit(center)

/**
* is container out of world bounds
* @return { left:boolean, right: boolean, top: boolean, bottom: boolean }
*/
OOB()
/**
* world coordinates of the right edge of the screen

@@ -168,0 +167,0 @@ * @type {number}

@@ -86,7 +86,7 @@ const Loop = require('yy-loop')

/**
* use this to set screen and world sizes--needed for most plugins
* use this to set screen and world sizes--needed for pinch/wheel/clamp/bounce
* @param {number} screenWidth
* @param {number} screenHeight
* @param {number} worldWidth
* @param {number} worldHeight
* @param {number} [worldWidth]
* @param {number} [worldHeight]
*/

@@ -97,4 +97,7 @@ resize(screenWidth, screenHeight, worldWidth, worldHeight)

this.screenHeight = screenHeight
this.worldWidth = worldWidth
this.worldHeight = worldHeight
if (worldWidth)
{
this.worldWidth = worldWidth
this.worldHeight = worldHeight
}
for (let plugin of this.plugins)

@@ -139,2 +142,7 @@ {

/**
* whether change exceeds threshold
* @private
* @param {number} change
*/
checkThreshold(change)

@@ -194,2 +202,8 @@ {

/**
* handle click events
* @private
* @param {number} x
* @param {number} y
*/
click(x, y)

@@ -251,3 +265,3 @@ {

/**
* @type {number} screen width in world coordinates
* @type {number} screen height in world coordinates
*/

@@ -272,2 +286,3 @@ get worldScreenHeight()

* @param {number} [y]
* @return {Viewport} this
*/

@@ -288,2 +303,3 @@ moveCenter(/*x, y | PIXI.Point*/)

this.container.position.set((this.worldScreenWidth / 2 - x) * this.container.scale.x, (this.worldScreenHeight / 2 - y) * this.container.scale.y)
return this
}

@@ -304,2 +320,3 @@

* @param {number} y
* @return {Viewport} this
*/

@@ -317,2 +334,3 @@ moveCorner(/*x, y | point*/)

this._reset()
return this
}

@@ -323,3 +341,4 @@

* @param {number} [width=container.width] in world coordinates; uses container.width if not provided
* @param {boolean} [center] maintain the same center
* @param {boolean} [center] maintain the same center
* @return {Viewport} this
*/

@@ -340,2 +359,3 @@ fitWidth(width, center)

}
return this
}

@@ -346,3 +366,4 @@

* @param {number} [width=container.height] in world coordinates; uses container.width if not provided
* @param {boolean} [center] maintain the same center of the screen after zoom
* @param {boolean} [center] maintain the same center of the screen after zoom
* @return {Viewport} this
*/

@@ -363,2 +384,3 @@ fitHeight(height, center)

}
return this
}

@@ -369,2 +391,3 @@

* @param {boolean} [center] maintain the same center of the screen after zoom
* @return {Viewport} this
*/

@@ -392,8 +415,9 @@ fit(center)

}
return this
}
/**
* is container out of world bounds
* @return { left:boolean, right: boolean, top: boolean, bottom: boolean }
* @private
*/

@@ -400,0 +424,0 @@ OOB()

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc