ID:1954220
 
(See the best response by Ter13.)
I've got some overlays on my player character like a helmet, sword, and armor. When I try to fade the character out using something like this;

Code:
animate(src, alpha = 0, time = 5)


Problem description:
I can see all the individual layers as they fade out instead of the having everything fade out as one entity or one layer.

Is there an easy way to fade my character and all the layers as one entity vs several?
Think I may have found my answer here:
http://www.byond.com/forum/?post=1454727
Sadly no; it's a function of how the individual icons are drawn. What you want would require all of the layers to be merged into a single icon, which is a job for icon math. I kind of wonder if an appearance flag could be used to force compositing, but IMO managing the composite sprites would get ugly really fast.
Best response
Unfortunately, BYOND renders each overlay as a separate part of the render "pass". In order for this to be possible, BYOND would have to be changed to force the entire sprite to be rendered to a backbuffer and then the backbuffer rendered to the main surface as a single image. This, however, would significantly break the way BYOND's layering works, in which every individual overlay/underlay isn't actually rendered in appropriate sequence, but rather sorted before render based on layer.

Although, I suppose switching over to shaders and using a z-buffer would also allow for this, but I'll let Lummox speak to the possibility of that.
Wouldn't you do something like this?
var/obj/O = new() // creates overlay datum
O = src.overlays // O is now all of your overlays.
animate (O , alpha = 0 , time = 5) // fades overlays
animate (src , alpha = 0 , time = 5) // fades you

//or

for(var/overlays/O in src.overlays)// all overlays in client.overlays.
animate (O , alpha = 0 , time = 5) // fades O overlays.
..()


Note I am on a iPhone typing this lol.
But I feel like this should work but I mean what do I know lol,
And if you've stated something about it not being possible I have read the comments yet haha, But hey I tried.
In response to Hebrons
So many problems there.

1) /overlays is not a valid path.

2) /client has no overlays var, and if it did, the contents would be appearances.

3) animate() can't be called on an appearance.

4) Animating individual overlays to change their alpha won't matter because by default they all carry their parent's alpha before applying their own.

5) The issue at hand is that the overlays and the main icon don't act as a single icon, which is visually more desirable.
In response to Hebrons
I don't think you can animate overlay appearances that directly.

However, even if you could, you would be applying alpha to each overlay independently, which almost always looks awful.

Here's an example from Flash that I dug up on Google. You can see all of the individual parts that make up the ghost, because each semi-transparent part is being blended separately: