Canvas Library
 

shadowOnly Library Method

Short Description: Control display of shadows on transition

Signature: t.shadowOnly ([enable])
Group: Light and Shadow
Class: transition Class
 

If enabled (enable=true or missing) then only the shadows on the element are drawn, not the element itself. The idea is that the user makes sure that the element itself is drawn using HTML+CSS while taccgl™ draws just the shadows on top of that.

Note that in contrast to castShadow, which controlls the shadows casted by this transition on other transitions, shadowOnly controlls the shadows other elements or objects cast on this transition.

Using LightAmbDiff and lightBgAmbDiff the color of the shadow can be controlled.

The color and texture of the element becomes almost irrelevant, since only the shadow but not the element is drawn. The texture is however relevant in so far as no shadow is drawn where the texture is transparent while there is no or a transparent background color given. If on the other hand a non-transparent color is given, then shadows are shown throughout the animated element and the texture becomes completely irrelevant.

taccgl.a(document.body).shadowOnly().paint().showAfter().start();
taccgl.actor("testimg").to(500,1000,-1000).dur(7).start();
taccgl.actor("ex1",null,null,2).to(500,1000,-2000).dur(7).start();
RUN
taccgl.a(document.body).shadowOnly().color("black").showAfter().start();
taccgl.actor("testimg").to(500,1000,-1000).dur(7).start();
taccgl.actor("ex1").to(500,1000,-2000).dur(7).start();
RUN
taccgl.actor("testimg").to(500,1000,-1000).dur(7).start();
taccgl.actor("ex1").shadowOnly().dur(7).start();
RUN
taccgl.actor("testimg").to(500,1000,-1000).dur(7).start();
taccgl.a("ex1").paint().shadowOnly().dur(7).start();
RUN
taccgl.actor("testimg").to(500,1000,-1000).dur(7).start();
taccgl.a("ex1").color("black").shadowOnly().dur(7).start();
RUN
taccgl.actor("testimg").to(500,1000,-1000).dur(7).start();
taccgl.actor("ex1").shadowOnly(false).dur(7).start();
RUN

WebGL™ is a trademark of the Khronos Group Inc.

Next Page:transition.castShadow - Control casting of shadows on other transitions
Previous Page: transition.specLight - Set specular light factor and shininess
Please Add a Comment or Question, click here!