dinther

Pixi coordinate system

Recommended Posts

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.