pyre Posted July 22, 2017 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! Link to comment Share on other sites More sharing options...
samme Posted July 22, 2017 Share Posted July 22, 2017 Did you try spriteBatch.filters = [ overlayFilter ]; ? Link to comment Share on other sites More sharing options...
pyre Posted July 22, 2017 Author 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) Link to comment Share on other sites More sharing options...
samme Posted July 22, 2017 Share Posted July 22, 2017 It may not work for sprite batches. Did you try with a group instead? pyre 1 Link to comment Share on other sites More sharing options...
pyre Posted July 22, 2017 Author Share Posted July 22, 2017 That worked! thanks samme :-) Link to comment Share on other sites More sharing options...
Recommended Posts