davidfig / pixi-scrollbox

a scrollbox built for pixi.js using a masked box that scrolls vertically and/or horizontally with optional scrollbars
https://www.npmjs.com/package/pixi-scrollbox
MIT License
170 stars 33 forks source link

problem with viewport.events #59

Open aram88888 opened 8 months ago

aram88888 commented 8 months ago

Just not working. package.json { "name": "pixiscr", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "dependencies": { "pixi-scrollbox": "^2.3.1", "pixi-viewport": "^5.0.2", "pixi.js": "^7.3.2", "webpack": "^5.89.0", "webpack-cli": "^5.1.4" } }

const PIXI = require('pixi.js') const Scrollbox = require('pixi-scrollbox').Scrollbox

// create the scrollbox const scrollbox = new Scrollbox({ boxWidth: 200, boxHeight: 200}) // add the viewport to the stage const app = new PIXI.Application() document.body.appendChild(app.view) app.stage.addChild(scrollbox);

ERRORS in console

  1. Uncaught TypeError: Cannot read properties of undefined (reading 'domElement')---- this.viewport.options.events.domElement
  2. Uncaught TypeError: Cannot read properties of undefined (reading 'update') --- this.plugins.update(t)
hanaogu commented 6 months ago
image