Arkless Posted January 10, 2017 Share Posted January 10, 2017 First off, PIXI is incredibly new to me so the problem might lie in my incompetence. What I did: var localOffset = mouseData.data.getLocalPosition(mouseData.data.target); console.log(JSON.stringify(localOffset)); mouseData being the input of multiple different mouse events (mousedown, mouseup, rightdown, rightup, mouseover) The rotation of my sprite is set to 0. What happens: The console prints {x:xval, y:yval} where xval changes when moving up/down and yval changes when moving rigth/left. As far as I can tell, everything else seems to work with x increasing towards the right and y increasing towards the bottom of the screen. I can easily work around this but it felt report worthy. Additional stuff that might be of interest: The local position seems to be correctly offsetted by the anchor. What feels wrong to me is that the distance does not take into account the width/height of the actual sprite, only the width/height of the texture being used. This might actually be working as intended but is not what I expected. Have a nice day, - Michael Ok, so it gets weirder (for me). To make sure no rotation data is screwing with me I hardcoded the rotation to different values. Rotation does not seem to influence my results. x and y are not only swapped, the sign of x (value found in y) is also inverted I get the expected values when using a PIXI.Container() instead of a sprite (no xy swap, no inverted sign). 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.