ashenemy Posted July 30, 2017 Share Posted July 30, 2017 Hello I have 2 sprite One size 1000 by 500 Second 100 per 100 It is necessary to specify the second sprite as a mask for the first I'm using the SpriteMaskFilter class All works except one, I can not understand how to specify the position of the mask, it is necessary that it would be possible to move it Thank you in advance Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 30, 2017 Share Posted July 30, 2017 you use sprite as a mask - add it to the stage, specify its position and it will be drawn as a mask in that exact place. You can move it like any other sprite, but it wont be rendered, it will be used as a mask Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 30, 2017 Share Posted July 30, 2017 According to https://github.com/pixijs/pixi.js/blob/dev/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js , when you create that filter, you can specify a mask sprite. If you want to use another sprite, just change "sprite" field and make sure that one sprite is not renderable. Quote Link to comment Share on other sites More sharing options...
ashenemy Posted July 31, 2017 Author Share Posted July 31, 2017 16 hours ago, ivan.popelyshev said: According to https://github.com/pixijs/pixi.js/blob/dev/src/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js , when you create that filter, you can specify a mask sprite. If you want to use another sprite, just change "sprite" field and make sure that one sprite is not renderable. Tnx)) 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.