Sign in to follow this  
Moppel

Extract WebGL pixels with offset position

Recommended Posts

When using extract pixels it seems that only content is extracted that starts from the origin and ignores the negative part of the axis. This is currently an issue for me as my indoor map is (approximately) centered at (0,0); So it will always reside partially in the negative coordinate areas. The container holding the map (a  sprite with scale.y =-1 and some position offset) and some other shapes (graphics) live in the pixi.viewport container (awesome plugin btw:) ) and my first guess was that temporarily shifting the position of the viewport might help but I think this transform is somehow only relative to the stage. When passing the stage to extract, the result is just all black  :(

Thank you very much

 

Share this post


Link to post
Share on other sites

Extract plugin and generateTexture() is pain if you pass a container THAT HAS A PARENT WITH NON-IDENTITY TRANSFORM. I've tried to fix it several times and my PR's affected many parts of pixi and weren't easy to review, so team rejected it.

If you want to know more about pain, search for "extract" and "generateTexture" in https://github.com/pixijs/pixi.js/issues

If you want to know how to fix pain - please remove container from parent before you call that thing, and add it to another parent which has offset that you need.

If it doesn't work, please make simple example for pixi-playground and we'll look at it.

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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.