Moppel Posted February 6, 2019 Share Posted February 6, 2019 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 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 6, 2019 Share Posted February 6, 2019 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. Quote Link to comment Share on other sites More sharing options...
Moppel Posted February 12, 2019 Author Share Posted February 12, 2019 I followed your advice in line 3 and added this as child to the stage, which in turn i use as container to extract the image from, works thanks! ivan.popelyshev 1 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.