pixi-viewport icon indicating copy to clipboard operation
pixi-viewport copied to clipboard

Detect clicks to 'blank' viewport?

Open deklanw opened this issue 3 years ago • 1 comments

I'm trying to detect clicks to the viewport which don't intersect with any interactive objects in order to get the "click blank space to reset state" effect.

For regular Pixi cases without this library I see people are creating a sprite that fills the background and detecting clicks on that. https://stackoverflow.com/a/63201945

But, when I try that trick with pixi-viewport I just get a sprite of fixed size when I zoom. Is there a way to do this without creating a background sprite and resizing it on every moved event?

deklanw avatar Aug 20 '22 15:08 deklanw

There's a clicked event in pixi-viewport that will trigger on a click anywhere on the viewport.

davidfig avatar Aug 20 '22 17:08 davidfig