I have been trying to find ways to fill the strokes of dynamic text for my own manipulation. With AS2 it was only possible by hard-coding the positions of the strokes of each letter and number. That’s cumbersome. But with AS3, we have getPixel(), a BitmapData method that returns the color value of any given pixel you point to. With this in mind, the approach follows:
1. Create a TextField and fill it with dynamic content as usual.
2. Set TextField visible to false. After all, our particles will spell out the words so we don’t need to see the TextField.
3. Using getPixel() to determine where the text is. For example, if your background is white and your text is black, you check for where the text is black, get that pixel’s position, and you know where to fill with a particle.
4. Create your particles based on the amount of pixels gotten from the Step 3, then lay them out and you’re done.
Here’s an example I call Clock displaying the time from your system. The result is not as anti-alias as I would like but the goal is achieved. Feel free to provide ideas for bettering this. =)

Be The First To Comment
Related Post
Please Leave Your Comments Below