magale Posted January 16, 2017 Share Posted January 16, 2017 Hi guys, i've bring this example with Pixijs and i've done a test. I put the canvas inside a div (#content), this div has transform: perspective(900px) and rotate(20deg). The hit area is not ok, 'cause has the old coordinates without calculate perspective. (see attachment) So, how can i get the new coords to pass to hitarea ? Thanks Quote Link to comment Share on other sites More sharing options...
magale Posted January 17, 2017 Author Share Posted January 17, 2017 Anything? Quote Link to comment Share on other sites More sharing options...
magale Posted January 18, 2017 Author Share Posted January 18, 2017 All advice are welcome Quote Link to comment Share on other sites More sharing options...
Fatalist Posted January 18, 2017 Share Posted January 18, 2017 See this answer: http://stackoverflow.com/questions/6773481/how-to-get-the-mouseevent-coordinates-for-an-element-that-has-css3-transform/7059054#7059054 I think that will give you the correct position and then use this function to find the clicked sprite: http://pixijs.download/release/docs/PIXI.interaction.InteractionManager.html#processInteractive Quote Link to comment Share on other sites More sharing options...
magale Posted January 19, 2017 Author Share Posted January 19, 2017 Thank for your advice but does not work. I need to update the hitArea coordinates every time the object is dragged. Quote Link to comment Share on other sites More sharing options...
magale Posted January 19, 2017 Author Share Posted January 19, 2017 ok, now it works. Thanks a lot. 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.