mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
rename script functions
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
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;" />
|
||||
@@ -1,17 +1,17 @@
|
||||
Function: crop
|
||||
|
||||
--Usage--
|
||||
> crop(input: image, height: height_of_new_image, width: width_of_new_image, offset_x: x_position_to_start_crop, offset_y: y_position_to_start_crop)
|
||||
|
||||
Shrink an image by cutting off some of the image, starting at the position denoted by the offsets. The resulting image size is specified in the parameters.
|
||||
|
||||
Resulting image can be bigger than the original, if offset_x or offset_y are negative, or if width or height are bigger than the original width and height.
|
||||
|
||||
--Parameters--
|
||||
! Parameter Type Description
|
||||
| @input@ [[type:image]] Image to enlarge
|
||||
| @height@ [[type:double]] Height of the resulting image, in pixels
|
||||
| @width@ [[type:double]] Width of the resulting image, in pixels
|
||||
| @offset_x@ [[type:double]] Offset of crop, horizontally, in pixels
|
||||
| @offset_y@ [[type:double]] Offset of crop, vertically, in pixels
|
||||
|
||||
Function: crop_image
|
||||
|
||||
--Usage--
|
||||
> crop_image(input: image, height: height_of_new_image, width: width_of_new_image, offset_x: x_position_to_start_crop, offset_y: y_position_to_start_crop)
|
||||
|
||||
Shrink an image by cutting off some of the image, starting at the position denoted by the offsets. The resulting image size is specified in the parameters.
|
||||
|
||||
Resulting image can be bigger than the original, if offset_x or offset_y are negative, or if width or height are bigger than the original width and height.
|
||||
|
||||
--Parameters--
|
||||
! Parameter Type Description
|
||||
| @input@ [[type:image]] Image to enlarge
|
||||
| @height@ [[type:double]] Height of the resulting image, in pixels
|
||||
| @width@ [[type:double]] Width of the resulting image, in pixels
|
||||
| @offset_x@ [[type:double]] Offset of crop, horizontally, in pixels
|
||||
| @offset_y@ [[type:double]] Offset of crop, vertically, in pixels
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
Function: drop_shadow
|
||||
|
||||
--Usage--
|
||||
> 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--
|
||||
> drop_shadow("image4.png", offset_x: 0.08, offset_y: 0.08, alpha: 0.5) == [[Image]]
|
||||
>>> 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;" />
|
||||
|
||||
> drop_shadow("image4.png", offset_x: -0.1, offset_y: 0.1, alpha: 1, color: rgb(0,0,255), blur_radius: 0.05) == [[Image]]
|
||||
>>> 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;" />
|
||||
@@ -1,16 +0,0 @@
|
||||
Function: enlarge
|
||||
|
||||
--Usage--
|
||||
> enlarge(input: image, border_size: amount_to_enlarge)
|
||||
|
||||
Enlarge an image by putting a transparent border around it.
|
||||
The border size is given in percentages of the image size, so @border_size: 1@ makes the image three times as large by putting a border of 100% the size on all sides.
|
||||
|
||||
--Parameters--
|
||||
! Parameter Type Description
|
||||
| @input@ [[type:image]] Image to enlarge
|
||||
| @border_size@ [[type:double]] Amount of border to add, in percentage of the image
|
||||
|
||||
--Examples--
|
||||
> enlarge(input: "image1.png", border_size: 0.1) == [[Image]]
|
||||
>>> enlarge(input: <img src="image1.png" alt='"image1.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />, border_size: 0.1) == <img src="image_enlarge.png" alt='"image_enlarge.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />
|
||||
@@ -0,0 +1,16 @@
|
||||
Function: enlarge_image
|
||||
|
||||
--Usage--
|
||||
> enlarge_image(input: image, border_size: amount_to_enlarge)
|
||||
|
||||
Enlarge an image by putting a transparent border around it.
|
||||
The border size is given in percentages of the image size, so @border_size: 1@ makes the image three times as large by putting a border of 100% the size on all sides.
|
||||
|
||||
--Parameters--
|
||||
! Parameter Type Description
|
||||
| @input@ [[type:image]] Image to enlarge
|
||||
| @border_size@ [[type:double]] Amount of border to add, in percentage of the image
|
||||
|
||||
--Examples--
|
||||
> enlarge_image(input: "image1.png", border_size: 0.1) == [[Image]]
|
||||
>>> enlarge_image(input: <img src="image1.png" alt='"image1.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />, border_size: 0.1) == <img src="image_enlarge.png" alt='"image_enlarge.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />
|
||||
@@ -1,20 +0,0 @@
|
||||
Function: flip_horizontal
|
||||
|
||||
DOC_MSE_VERSION: since 0.3.9
|
||||
|
||||
--Usage--
|
||||
> flip_horizontal(input: image)
|
||||
|
||||
Flip an image horizontally.
|
||||
|
||||
--Parameters--
|
||||
! Parameter Type Description
|
||||
| @input@ [[type:image]] Image to flip.
|
||||
|
||||
--Examples--
|
||||
> flip_horizontal("image_logo.png") == [[Image]]
|
||||
>>> flip_horizontal(<img src="image_logo.png" alt='"image_logo.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />) == <img src="image_logo_hflip.png" alt='"image_logo_hflip.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />
|
||||
|
||||
--See also--
|
||||
| [[fun:flip_vertical]] Flip an image vertically
|
||||
| [[fun:rotate]] Rotate an image
|
||||
@@ -0,0 +1,18 @@
|
||||
Function: flip_image
|
||||
|
||||
--Usage--
|
||||
> flip_image(input: image, horizontal: true)
|
||||
|
||||
Flip an image horizontally or vertically.
|
||||
|
||||
--Parameters--
|
||||
! Parameter Type Description
|
||||
| @input@ [[type:image]] Image to flip.
|
||||
| @horizontal@ [[type:boolean]] Flip horizontally or vertically?
|
||||
|
||||
--Examples--
|
||||
> flip_image("image_logo.png") == [[Image]]
|
||||
>>> flip_image(<img src="image_logo.png" alt='"image_logo.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />) == <img src="image_logo_vflip.png" alt='"image_logo_vflip.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />
|
||||
|
||||
--See also--
|
||||
| [[fun:rotate]] Rotate an image
|
||||
@@ -1,20 +0,0 @@
|
||||
Function: flip_vertical
|
||||
|
||||
DOC_MSE_VERSION: since 0.3.9
|
||||
|
||||
--Usage--
|
||||
> flip_vertical(input: image)
|
||||
|
||||
Flip an image vertically.
|
||||
|
||||
--Parameters--
|
||||
! Parameter Type Description
|
||||
| @input@ [[type:image]] Image to flip.
|
||||
|
||||
--Examples--
|
||||
> flip_vertical("image_logo.png") == [[Image]]
|
||||
>>> flip_vertical(<img src="image_logo.png" alt='"image_logo.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />) == <img src="image_logo_vflip.png" alt='"image_logo_vflip.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />
|
||||
|
||||
--See also--
|
||||
| [[fun:flip_horizontal]] Flip an image horizontally
|
||||
| [[fun:rotate]] Rotate an image
|
||||
+11
-12
@@ -86,24 +86,23 @@ These functions are built into the program, other [[type:function]]s can be defi
|
||||
| [[fun:set_mask]] Set the transparancy mask of an image.
|
||||
| [[fun:set_alpha]] Change the transparency of an image.
|
||||
| [[fun:set_combine]] Change how the image should be combined with the background.
|
||||
| [[fun:saturate]] Saturate/desaturate an image.
|
||||
| [[fun:saturate_image]] Saturate/desaturate an image.
|
||||
| [[fun:invert_image]] Invert the colors of an image.
|
||||
| [[fun:recolor_image]] Change the colors of an image to match the font color.
|
||||
| [[fun:resize_image]] Stretch or squeeze an image to a given height and width.
|
||||
| [[fun:enlarge]] Enlarge an image by putting a border around it.
|
||||
| [[fun:enlarge_image]] Enlarge an image by putting a border around it.
|
||||
| [[fun:crop_image]] Crop an image, giving only a small subset of it.
|
||||
| [[fun:insert_image]] Insert an image inside another.
|
||||
| [[fun:flip_image]] Flip an image horizontally or vertically.
|
||||
| [[fun:rotate_image]] Rotate an image.
|
||||
| [[fun:add_stroke_effect]] Add a stroke effect around an image.
|
||||
| [[fun:add_bleed_edge]] Add a crude print bleed edge around an image.
|
||||
| [[fun:crop]] Crop an image, giving only a small subset of it.
|
||||
| [[fun:flip_horizontal]] Flip an image horizontally.
|
||||
| [[fun:flip_vertical]] Flip an image vertically.
|
||||
| [[fun:rotate_image]] Rotate an image.
|
||||
| [[fun:drop_shadow]] Add a drop shadow to an image.
|
||||
| [[fun:insert_image]] Insert an image inside another.
|
||||
| [[fun:add_drop_shadow]] Add a drop shadow to an image.
|
||||
| [[fun:dimensions_of]] Get the width and height of an image.
|
||||
| [[fun:symbol_variation]] Render a variation of a [[type:symbol]].
|
||||
| [[fun:import_image]] Load an image from outside the data folder.
|
||||
| [[fun:download_image]] Download an image from a URL.
|
||||
| [[fun:built_in_image]] Return an image built into the program.
|
||||
| [[fun:symbol_variation]] Render a variation of a [[type:symbol]].
|
||||
| [[fun:import_image]] Load an image from outside the data folder.
|
||||
| [[fun:download_image]] Download an image from a URL.
|
||||
| [[fun:built_in_image]] Return an image built into the program.
|
||||
|
||||
! Cards <<<
|
||||
| [[fun:new_card]] Construct a new [[type:card]] object.
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
Function: saturate
|
||||
|
||||
DOC_MSE_VERSION: since 0.3.9
|
||||
|
||||
--Usage--
|
||||
> saturate(input: image, amount: saturation amount)
|
||||
|
||||
Saturate or desaturate an image. Saturation makes the colors brighter, desaturation makes the image more grey.
|
||||
|
||||
To saturate use an amount between @0@ (no saturation) and @1@ (super crazy, too much saturation).
|
||||
|
||||
To desaturate use an amount between @0@ (no desaturation) and @-1@ (convert to greyscale).
|
||||
|
||||
--Parameters--
|
||||
! Parameter Type Description
|
||||
| @input@ [[type:image]] Image to (de)saturate.
|
||||
| @alpha@ [[type:double]] Saturation factor.
|
||||
|
||||
--Examples--
|
||||
> saturate("image5.png", amount: 0.5) == [[Image]]
|
||||
>>> saturate(<img src="image5.png" alt='"image5.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />, amount: 0.5) == <img src="image_saturate1.png" alt='"image_saturate1.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />
|
||||
> saturate("image5.png", amount: -0.5) == [[Image]]
|
||||
>>> saturate(<img src="image5.png" alt='"image5.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />, amount: -0.5) == <img src="image_saturate2.png" alt='"image_saturate2.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />
|
||||
> saturate("image_logo.png", amount: -1) == [[Image]]
|
||||
>>> saturate(<img src="image_logo.png" alt='"image_logo.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />, amount: -1) == <img src="image_logo_desaturate.png" alt='"image_logo_desaturate.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />
|
||||
@@ -0,0 +1,25 @@
|
||||
Function: saturate_image
|
||||
|
||||
DOC_MSE_VERSION: since 0.3.9
|
||||
|
||||
--Usage--
|
||||
> saturate_image(input: image, amount: saturation amount)
|
||||
|
||||
Saturate or desaturate an image. Saturation makes the colors brighter, desaturation makes the image more grey.
|
||||
|
||||
To saturate use an amount between @0@ (no saturation) and @1@ (super crazy, too much saturation).
|
||||
|
||||
To desaturate use an amount between @0@ (no desaturation) and @-1@ (convert to greyscale).
|
||||
|
||||
--Parameters--
|
||||
! Parameter Type Description
|
||||
| @input@ [[type:image]] Image to (de)saturate.
|
||||
| @alpha@ [[type:double]] Saturation factor.
|
||||
|
||||
--Examples--
|
||||
> saturate_image("image5.png", amount: 0.5) == [[Image]]
|
||||
>>> saturate_image(<img src="image5.png" alt='"image5.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />, amount: 0.5) == <img src="image_saturate1.png" alt='"image_saturate1.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />
|
||||
> saturate_image("image5.png", amount: -0.5) == [[Image]]
|
||||
>>> saturate_image(<img src="image5.png" alt='"image5.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />, amount: -0.5) == <img src="image_saturate2.png" alt='"image_saturate2.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />
|
||||
> saturate_image("image_logo.png", amount: -1) == [[Image]]
|
||||
>>> saturate_image(<img src="image_logo.png" alt='"image_logo.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />, amount: -1) == <img src="image_logo_desaturate.png" alt='"image_logo_desaturate.png"' style="border:1px solid black;vertical-align:middle;margin:1px;" />
|
||||
Reference in New Issue
Block a user