With starling v1.3 came the introduction of filters.
In this post i will show how to use the DropShadow filter.
the fiilter takes 6 Parameters: Distance, angle, colour, alpha, blur, resolution.
Make sure you download the latest version of starling and add it to your project http://github.com/PrimaryFeather/Starling-Framework/zipball/v1.3
// import the filter import starling.filters.BlurFilter; //apply it to a starling object starlingMc.filter = BlurFilter.createDropShadow(4,0.785,0x000000,0.5,0.3,0.6);
During my early tests i created a reusable filter var and applied it to all the required sprites. This caused a massive draw call increase and caused my the iPad3 to crap out.
After some investigation it was concluded you must not reuse a filter for multiple sprites, instead you must attach a new filter every time. Kind of goes against the DRY principle, but thats just the way it currently is.
I was playing around with the glow filter, but as soon as I attach 3 of them to 3 different objects, the app becomes quite laggy.
What platform/device are you testing on? I found desktop builds to work some what well, but mobile is another thing.
I’d be interested to see know the different speeds of different filters.
As an alternative to the Glow Filter, I would use a generic png closely matching the shape of your target objects(created in Photoshop) I would keep this glow graphic in the same sprite sheet as the objects being made to glow, so there’s no extra draw calls.
Id be interested to know if you found any solutions or alternatives!