|
-
A method to dynamically change the outline of a sprite?
So I've a bunch of pngs I'm loading into sprites that are the shapes of countries...these pngs are solid colors...I'd like to, inside my program, just highlight the outlines of these shapes...Is there anyway to do this dynamically, rather than creating files for both outlines and fills of these countries and loading both in?
-
You should be able to apply a ConvolutionFilter with a "find edges" matrix to extract the edges in your pngs.
http://livedocs.adobe.com/flash/9.0/...ionFilter.html
http://homepages.inf.ed.ac.uk/rbf/HIPR2/sobel.htm
-
Thanks, that did the trick? Is there a streamlined way to just store the outline produced by applying the filter into another Sprite, other than duplicating the sprite, applying the filter, and then somehow deleting the fill shape?
-
Draw your Sprite into a BitmapData, then use applyFilter on that BitmapData to get the edges.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|