dinther Posted May 28, 2015 Share Posted May 28, 2015 I have a container that contains another pixi element. A graphics object in this example. As pixi is a scene graph I can rotate the container and the grapics object contained within is rotated too.Now I attach a mousemove event to the graphics object and I convert the event coordinate to the graphics object like var pos = event.data.getLocalPosition(graphics); However, it appears to be that the coordinate system scales and translates but does not rotate. See this fiddle to illustrate. When you move the cursor along the length of the rectangle I expect no change in y and only a change in x. http://jsfiddle.net/sD8Tt/204/ What I require is event coordinates that are aligned with the graphics object. How do I do this or what am I doing wrong? Quote Link to comment Share on other sites More sharing options...
dinther Posted July 22, 2015 Author Share Posted July 22, 2015 Please please please respond developers. I am stuck and I still think there is a bug when rotation is used in conjunction with getLocalPosition. (Pixi version 3.0.7) Checkout this fiddle: http://jsfiddle.net/sD8Tt/231/ The working example returns the correct coordinates for the graphics object when position is set and scale is set. However, when graphics is rotated the coordinates are wrong and make no sense to me in any context. Quote Link to comment Share on other sites More sharing options...
xerver Posted July 22, 2015 Share Posted July 22, 2015 There is an open bug for this: https://github.com/GoodBoyDigital/pixi.js/issues/1896 Quote Link to comment Share on other sites More sharing options...
dinther Posted July 23, 2015 Author Share Posted July 23, 2015 Awesome. Thank you. At least I know I wasn't doing anything wrong. I make sure to search the bug database next time. The solutions offered on https://github.com/GoodBoyDigital/pixi.js/issues/1896 swapping global.x and global.y do work for me but that may not be the source of the problem. 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.