Thursday, May 27, 2010

Sparklies!



No large version.

Okay, so thanks to this, I feel I've gained a little knowledge in the world of the BitmapData class in Flash. And good god...if you want some absolutely stunning effects, learn more about it! What we've got here is essentially a Bitmap (literally a...map of bits...) that is showing off its pixel data (naughty!). Since this data is now available to us, we can manipulate it however we'd like. In this case, we're putting a little glow and blur filters on it. HOWEVER...the Bitmap that we've drawn on the stage is a solid rectangle. So why does that glow appear inside this rectangle?

Enter the "draw" method of the BitmapData. See those little flickery particles? Those act as "holes" in the BitmapData. Every frame, Flash is redrawing that initial rectangle and taking a peek at what it looks like. If we have one of our particles over the rectangle, that rectangle isn't visible where the particle exists. So, as far as Flash is concerned there's nothing there. So we get a hole...a hole that can have a blur and glow filter applied to it! Nifty!

No comments:

Post a Comment