kidos Posted July 19, 2014 Share Posted July 19, 2014 can somebody tell me how to use css3filters plugin? let's say blur on a sprite? At the moment I add the .js file to my game I'm getting js error: Uncaught TypeError: Cannot set property 'CSS3Filters' of undefined Thanks in advance. Link to comment Share on other sites More sharing options...
kidos Posted July 31, 2014 Author Share Posted July 31, 2014 bump Link to comment Share on other sites More sharing options...
Binary Moon Posted July 31, 2014 Share Posted July 31, 2014 the css3 filters will only work in webkit browsers (Chrome and Safari) and will affect the entire canvas. As nice as it would be it can't be applied to individual elements drawn on a canvas. I haven't used them myself but I imagine that if you're using webgl then the shaders may do the sort of things you are looking for. Link to comment Share on other sites More sharing options...
kidos Posted July 31, 2014 Author Share Posted July 31, 2014 the css3 filters will only work in webkit browsers (Chrome and Safari) and will affect the entire canvas. As nice as it would be it can't be applied to individual elements drawn on a canvas. I haven't used them myself but I imagine that if you're using webgl then the shaders may do the sort of things you are looking for.Thanks for the info, I'm using canvas though Is there any solution in canvas to blur single sprite? Link to comment Share on other sites More sharing options...
Binary Moon Posted August 1, 2014 Share Posted August 1, 2014 there probably is but it's not something i can help with I'm afraid. I also imagine it would be quite slow. It might be best if you just make multiple copies of your sprite - one not blurred, and one blurred, and swap as needed. Link to comment Share on other sites More sharing options...
lewster32 Posted August 1, 2014 Share Posted August 1, 2014 You could maybe use this to manipulate a BitmapData version of your sprite? BitmapData creates a canvas context that you can then apply any operations you like to. clark 1 Link to comment Share on other sites More sharing options...
kidos Posted August 2, 2014 Author Share Posted August 2, 2014 thank you both, I'll try that. Link to comment Share on other sites More sharing options...
Recommended Posts