pyre Posted July 22, 2017 Report Share Posted July 22, 2017 Hi guys, I have a sprite batch containing 250+ 64x64 sprites from a single tileset / spritesheet. I need to apply a filter to the entire batch rather than per-sprite (way too slow!) I seem to only be able to add filters to the stage or single sprites. Anything else seems to do nothing. Is there any way I can do this? My original goal is to create an Overlay filter (Since the overlay blend mode doesn't work in WebGL) and apply it to all the sprites so they mix correctly with what is rendered underneath them. Thanks! Quote Link to comment Share on other sites More sharing options...
samme Posted July 22, 2017 Report Share Posted July 22, 2017 Did you try spriteBatch.filters = [ overlayFilter ]; ? Quote Link to comment Share on other sites More sharing options...
pyre Posted July 22, 2017 Author Report Share Posted July 22, 2017 10 minutes ago, samme said: Did you try spriteBatch.filters = [ overlayFilter ]; ? Yes, this does nothing. I'm not sure why though. Placing the same filter on the individual sprites works fine (besides lowering the frame rate to <10 fps) Quote Link to comment Share on other sites More sharing options...
samme Posted July 22, 2017 Report Share Posted July 22, 2017 It may not work for sprite batches. Did you try with a group instead? pyre 1 Quote Link to comment Share on other sites More sharing options...
pyre Posted July 22, 2017 Author Report Share Posted July 22, 2017 That worked! thanks samme :-) 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.