GBear Posted December 31, 2018 Share Posted December 31, 2018 hi. Can image or container or basetexture can get pixeldata like imagedata? I wanna spawn particle on part of drawing position. so I wanna get pixeldata from image like sprite, container, texture or basetexture do you have any idea? Quote Link to comment Share on other sites More sharing options...
Exca Posted December 31, 2018 Share Posted December 31, 2018 You can use extract-plugin that is found on renderer. renderer.plugins.extract.pixels( targetContainer ); http://pixijs.download/dev/docs/PIXI.extract.html Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 31, 2018 Share Posted December 31, 2018 And if you encounter any strange things: wrong translations, premultiplied alpha - look in pixijs issues on github, we have several threads about it, with code snippets that you can port to your pixijs version. Basically, its all "generateTexture" and "readPixels" Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 31, 2018 Share Posted December 31, 2018 You can snatch improved code from here: https://github.com/pixijs/pixi.js/pull/4632 It has several good classes that manage bitmap state. Quote Link to comment Share on other sites More sharing options...
botmaster Posted January 10, 2019 Share Posted January 10, 2019 Note that this is an expensive operation memory and CPU wise. 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.