Closed dineug closed 11 months ago
I've faced the same problem can't use getLocalPosition() function event
I'm also getting a deprecated
message. I have tested it only on pixi.js 7.2.4 and 7.1.4.
PixiJS Deprecation Warning: renderer.plugins.interaction has been deprecated, use renderer.events
Deprecated since v7.0.0
This is a potentially game-breaking issue, can a maintainer chime in?
If you're not importing pixi.js
to auto-register all the plugins, you'll need to import each system. In this case, add
import '@pixi/events';
to your root file.
I was easily able to duplicate this issue and I don't see any way to fix it. I tried import '@pixi/events
, but that obviously does nothing since pixi is already being imported. Here is a code sandbox that shows a minimal reproduction using all the latest pixi and react dependencies: https://codesandbox.io/s/compassionate-microservice-thp345?file=/src/index.tsx
I just wired up a click handler on a div
element and a click handler on an @pixi-react
Sprite
. Only the div
click works.
@Blacktiger For your case, you're not setting eventMode
on the Sprite. Try setting eventMode="static"
in the props.
Thanks @lunarraid. For some reason I thought that I didn't need to do that with regular pixi but I guess I must have missed how that worked.
Current Behavior
pixi.js v7.2.3 events not working
Expected Behavior
events must work.
Steps to Reproduce
https://stackblitz.com/edit/vitejs-vite-srtkkk?file=src/main.tsx
Environment
@pixi/react
version: ^7.0.3pixi.js
version: ^7.2.3React
version: ^18.2.0ReactDOM
version: ^18.2.0Possible Solution
Additional Information
No response