From 63a3697c294370d6aaaaa3fd71a2808791bcf188 Mon Sep 17 00:00:00 2001 From: Elliot Date: Tue, 5 Mar 2024 18:44:11 +0000 Subject: [PATCH] Pass PIXI application to the scrollbox.js so we can get the events --- src/scrollbox.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/scrollbox.js b/src/scrollbox.js index 2c5dd5b..1fffe58 100644 --- a/src/scrollbox.js +++ b/src/scrollbox.js @@ -55,6 +55,7 @@ export class Scrollbox extends PIXI.Container { * @param {boolean} [options.clampWheel=true] wheel events should be clamped (to avoid weird bounce with mouse wheel) * @param {PIXI.InteractionManager} [options.interaction] InteractionManager, available from instantiated PIXI.Renderer.plugins.interaction - used to calculate pointer postion relative to canvas location on screen * @param {HTMLElement} [options.divWheel] the HTMLElement to use for wheel interactions + * @param {PIXI.APPLICATION} [options.app] - the pixi application. */ constructor(options = {}) { super() @@ -76,6 +77,7 @@ export class Scrollbox extends PIXI.Container { screenHeight: this.options.boxHeight, interaction: this.options.interaction, divWheel: this.options.divWheel, + events: options.app.renderer.events })) this.content .decelerate()