Sentinel Posted February 21, 2018 Share Posted February 21, 2018 I'm totally in love with Pixi and have been for a while, but I'm running into an issue. So everything gets drawn correctly as it should. Now the issue is when I have to add interactivity to the actual Graphics element. Defining an any properties to the class such as "interactive" or "buttonMode" doesn't get applied to the actual Graphics element. Adding them after calling the super() method doesn't change anything either. I've created a gist including the files used for this exactly: https://gist.github.com/marcus-sa/3ec603f8f9c5d4bb6b0df514a4546c07 ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 21, 2018 Share Posted February 21, 2018 Its based on EventEmitter3, "on('click', () => {...} )" . Adding click methods works only from outside because click is a property , when you set it, it actually calls "on('click')". Here you just overrode it and "on" wasnt called. P..S. Also please dont use "renderer.width", it uses real pixels, you need CSS ones, "renderer.screen.width" . Of course its the same in your project, but when you add resolution (retina support) , those values will differ. Quote Link to comment Share on other sites More sharing options...
Sentinel Posted February 21, 2018 Author Share Posted February 21, 2018 Thanks for the fast reply. Sadly, it didn't make a difference at all. The graphics element is still not interactive, no matter where I assign the "interactive" property EDIT: I also discovered that none of the events works for any Pixi element regardless which it is. It worked flawlessly earlier, but all of suddenly it doesn't anymore. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 22, 2018 Share Posted February 22, 2018 Make a fiddle. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.