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…
» View the brushes
Source code: BruschTest_src ( It’s a mess! )

















Really nice! The only thing I find weird is the shrinking of the line’s start on mouse-move. Is that on purpose ?
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.
Aah, I see now. (Didn’t even notice the other 3 brushes at first :$)
Great job! Really fun to play with
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.
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