Custom Brushes with ActionScript

// January 10th, 2010 // Experiments, Source code & tutorials

I saw them on the Interwebs, but how did they do it?

I tried it with “BitmapFilling” a stroke of triangles…


actionscript brushes

» View the brushes

Source code: BruschTest_src ( It’s a mess! )

Share:

Post on Twitter
Share on Facebook
Bookmark this on Delicious
Share on LinkedIn
Stumble Now!
Digg This
Reddit This
Vote on DZone

5 Responses to “Custom Brushes with ActionScript”

  1. Really nice! The only thing I find weird is the shrinking of the line’s start on mouse-move. Is that on purpose ?

  2. kris says:

    Brush 1 and 4 are stretching a bitmap over the whole line (2 and 3 are repeating) You can see that more clear with brush 4 if you draw slow. The start of the bitmap is a point, that’s why you have that effect. :)

  3. Aah, I see now. (Didn’t even notice the other 3 brushes at first :$)

    Great job! Really fun to play with :)

  4. RC-1290'Dreadnought' says:

    Why don’t you just copy the pixels of the brush in its current position, with its current orientation, into one bitmapData, every frame? That way you don’t get the weird stretching.

  5. kris says:

    Hi RC_1290,
    In most cases you want to Bitmapdata.draw() your line every frame, like you say.
    But the point is that you also can stretch a bitmap over the whole line :)

Leave a Reply