You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Moves pixi-viewport to pixi.js v7 (thanks [@cuire](https://github.com/cuire)!).
16
+
17
+
NOTE: there is a breaking change since pixi-viewport moved to pixi's new event system. `options.interaction` is removed and you need pass `options.events` to the viewport for it to work properly. The events object can be found at pixi's `renderer.events` or `app.renderer.events`.
// const viewport = new Viewport({ events: app.renderer.events });
24
+
```
25
+
14
26
## v4.30.0+
15
27
This project was migrated to Typescript (thanks [@ShukantPal](https://github.com/ShukantPal)!). All functionality should be the same. The live Example has been updated.
16
28
@@ -40,7 +52,7 @@ const viewport = new Viewport({
40
52
worldWidth:1000,
41
53
worldHeight:1000,
42
54
43
-
interaction:app.renderer.plugins.interaction// the interaction module is important for wheel to work properly when renderer.view is placed or scaled
55
+
events:app.renderer.events// the interaction module is important for wheel to work properly when renderer.view is placed or scaled
This project was migrated to Typescript (thanks [@sukantpal](https://github.com/SukantPal)!). All functionality should be the same. The live Example has been updated.
123
-
124
133
## Other Libraries
125
134
If you liked pixi-viewport, please try my other open source libraries:
126
135
*[pixi-scrollbox](https://github.com/davidfig/pixi-scrollbox) - pixi.js scrollbox: a masked box that can scroll vertically or horizontally with scrollbars (uses pixi-viewport)
@@ -129,4 +138,4 @@ If you liked pixi-viewport, please try my other open source libraries:
129
138
130
139
## license
131
140
MIT License
132
-
(c) 2021[YOPEY YOPEY LLC](https://yopeyopey.com/) by David Figatner ([email protected])
141
+
(c) 2023[YOPEY YOPEY LLC](https://yopeyopey.com/) by David Figatner ([email protected])
Copy file name to clipboardExpand all lines: docs/public/sample/viewport.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ export function create(renderer) {
27
27
// forceHitArea: null, // change the default hitArea from world size to a new value
28
28
// noTicker: false, // set this if you want to manually call update() function on each frame
29
29
// ticker: PIXI.Ticker.shared, // use this PIXI.ticker for updates
30
-
interaction: renderer.plugins.interaction,// InteractionManager, available from instantiated WebGLRenderer/CanvasRenderer.plugins.interaction - used to calculate pointer position relative to canvas location on screen
30
+
events: renderer.events,// Events - used to calculate pointer position relative to canvas location on screen
31
31
// divWheel: null, // div to attach the wheel event (uses document.body as default)
32
32
// disableOnContextMenu: false, // remove oncontextmenu=() => {} from the divWheel element
0 commit comments