Name
SetLayerShadow -- enable/disable drop shadow for layer (V5.0)
Synopsis
SetLayerShadow(layer, enable[, color, radius, size, dir])
Function
This command can be used to enable or disable a shadow effect for the specified layer or layer group depending on whether the enable argument is set to True or False. In the third argument you can specify the color of the shadow. This will usually be #BLACK but combined with a transparency value because simple opaque black does not look too good as a shadow. You can use the ARGB() function to combine a transparency value and a color into an ARGB color. The optional arguments radius and size can be used to control the shadow's smoothness and size. Usually, both values are set to about the same value. Finally, the dir argument can be used to control the shadow's direction. This argument must be set to one of Hollywood's directional constants. See Directional constants for details.

Please note that drop shadows can become quite heavy on the CPU because Hollywood has to recalculate them whenever the layer's contents change. Normally, this does not happen too often. There is one prominent exception, though: When you run a transition effect on a layer that has a drop shadow. In that case, Hollywood has to remake the drop shadow for every new frame of the transition effect. On slower systems this can quite possibly kill the show so that you might want to turn off drop shadows before running a transition effect on a layer.

You can also use the SetLayerStyle() function to enable/disable the drop shadow of a layer, or to modify the drop shadow's parameters.

Inputs
layer
layer or layer group to use
enable
whether to enable or disable the layer drop shadow (True means enable, False means disable)
color
optional: color that shall be used by the drop shadow inARGB notation (defaults to $80000000 which means black with 50% transparency)
radius
optional: radius for shadow smoothing (defaults to 5)
size
optional: size of shadow shift from main layer (defaults to 4)
dir
optional: light direction of drop shadow (defaults to #SHDWSOUTHEAST)
Example
EnableLayers
SetFillStyle(#FILLCOLOR)
Box(#CENTER, #CENTER, 320, 240, #RED)
SetLayerShadow(1, True)
The code above draws a red box to the center of the display and then adds a shadow to it.

Show TOC