SoldjahBoy
Webgl doesn't get along with my PC so I'm not really working on shaders anymore.
The shader works by taking the source texture's alpha and making a colored silhouette. Then that is duplicated eight times and each one is moved in a different direction. The first to the right, the second down-right, the third down, and so on...
To make it outline multiple objects as if they were one object you need to Make them one image first. That's what layers do, so a layer per multi-part object could be one solution?
You could instead use the paster object. Basically by drawing each group of objects to their own paster instance and applying the outline effect to that.
I've become rusty with making shaders and since I can't test them I can't come up with ways to change the blend mode or opacity of them. However the outline can be done with the paster object without webgl and the end result is an the paster object will have the outline as a texture so you can draw it any way you'd like.
I'm not able to make a capx right now but here's how to do it:
First create a paster object and rename it outline. Make sure it's a little bigger than the object you want to draw and make it's origin centered.
For simplicity we'll outline a Sprite. The events would look like this:
Global number linewidth=4
Every tick
--- outline: clear to rgba(0,0,0,0)
--- outline: set quad color to rgba(0,0,0,1)
Repeat 8 times
--- outline: set position to Sprite
--- outline: move linewidth pixels at loopindex*45 degrees
--- outline: paste Sprite
Every tick
--- outline: set position to Sprite
--- Sprite: set blend mode to destination-out
--- outline: paste Sprite
--- Sprite: set blend mode to normal
--- outline: draw quad (0,0, 640,0, 640,480, 0,480) with blend mode destination-in
That should do it. The quad color is whatever color you want to use and when the quad is drawn on the paster with the destination-in blend it colors the outline. I was a tad lazy with the corners of the quad, it just needs to cover the outline object so you could use the bbox expressions instead. Anyways barring anything I overlooked that should give you a way to do a outline with the paster object. I'll try to make up a more re-useable example later.