Canvas Library

castShadow Library Method

Short Description: Control casting of shadows on other transitions

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

By default or if explicitly enabled (enable=true or missing) then taccgl™ automatically calculates shadows casted from this transition on other transitions. In rare cases it is useful to disable castShadow. If disabled this transition will not cast any shadows. So from the perspective of the shadow drawing even if the drawn element or object is between the light source and another element or object, no shadow will appear on the other element or object.

castShadow does not effect shadows drawn on the animated element or object itself.

Using castShadow is sometimes useful, if the shadow is drawn by some other means, e.g. CSS. Please compare the second and third example below and watch the shadow of the main text box. As long as the examples are not running the main text box has a shadow created with CSS. When you start the second example (that does not use castShadow) the shadow becomes darker, because taccgl™ adds its own shadow in addition to the CSS shadow. Using castShadow this effect is corrected in the third example.

Next Page:transition.posZ - Move in Eye Direction
Previous Page: transition.shadowOnly - Control display of shadows on transition