Files
MagicSetEditor2/doc/function/add_drop_shadow.txt
2026-01-19 16:46:54 +01:00

29 lines
1.9 KiB
Plaintext

Function: add_drop_shadow
--Usage--
> add_drop_shadow(image, offset_x: offset, offset_y: offset)
Add a drop shadow to an image.
The shadow is based on the opacity of the image.
To make sure the shadow doesn't fall outside the image, it can be a good idea to [[fun:enlarge]] the image first.
--Parameters--
! Parameter Type Default Description
| @input@ [[type:image]] Image to add drop shadow to
| @offset_x@ [[type:double]] 0 Relative position of the shadow, a positive number moves the shadow to the left.<br />
Value is in the range 0 (no movement) to 1 (move by the width of the image)
| @offset_y@ [[type:double]] 0 Relative position of the shadow, a positive number moves the shadow down.<br />
Value is in the range 0 (no movement) to 1 (move by the height of the image)
| @blur_radius@ [[type:double]] 0 Amount to blur the shadow.
| @alpha@ [[type:double]] 0 Opacity of the shadow, in the range 0 (fully transparent) to 1 (fully opaque)
| @color@ [[type:color]] black Color of the shadow.
--Examples--
> add_drop_shadow("image4.png", offset_x: 0.08, offset_y: 0.08, alpha: 0.5) == [[Image]]
>>> add_drop_shadow(<img src="image4.png" alt='"image1.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />, offset_x: 0.08, offset_y: 0.08, alpha: 0.5) == <img src="image_drop_shadow_1.png" alt='"image_drop_shadow_1.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />
> add_drop_shadow("image4.png", offset_x: -0.1, offset_y: 0.1, alpha: 1, color: rgb(0,0,255), blur_radius: 0.05) == [[Image]]
>>> add_drop_shadow(<img src="image4.png" alt='"image1.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />, offset_x: -0.1, offset_y: 0.1, alpha: 1, color: rgb(0,0,255), blur_radius: 0.05) == <img src="image_drop_shadow_2.png" alt='"image_drop_shadow_1.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />