mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Implement unique IDs and card linking
This commit is contained in:
@@ -5,11 +5,13 @@ Function: 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
|
||||
| @width@ [[type:double]] Width of the resulting image
|
||||
| @offset_x@ [[type:double]] Offset of crop, horizontally
|
||||
| @offset_y@ [[type:double]] Offset of crop, vertically
|
||||
| @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
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
Function: dimensions_of
|
||||
|
||||
--Usage--
|
||||
> dimensions_of(input: image)
|
||||
|
||||
Returns an array containing the width and height of the image in pixels.
|
||||
|
||||
--Parameters--
|
||||
! Parameter Type Description
|
||||
| @input@ [[type:image]] Image to whos dimensions we want.
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
Function: get_card_from_link
|
||||
|
||||
--Usage--
|
||||
> get_card_from_link(card: card, "link type")
|
||||
|
||||
Inspects a given [[type:card]]'s links to find one of the given type, and returns the linked card.
|
||||
Returns nil if no card was found.
|
||||
|
||||
--Parameters--
|
||||
! Parameter Type Description
|
||||
| @input@ [[type:string]] The type of link we want to find.
|
||||
| @card@ [[type:card]] The card whose links we'll inspect.
|
||||
| @set@ [[type:set]] The set in which to look. This can be omited since 'set' is a predefined variable.
|
||||
@@ -0,0 +1,12 @@
|
||||
Function: get_card_from_uid
|
||||
|
||||
--Usage--
|
||||
> get_card_from_uid(input: "uid")
|
||||
|
||||
Returns the [[type:card]] with the given uid inside the set.
|
||||
Returns nil if no card was found.
|
||||
|
||||
--Parameters--
|
||||
! Parameter Type Description
|
||||
| @input@ [[type:string]] The uid of the card we want to retrieve.
|
||||
| @set@ [[type:set]] The set in which to look. This can be omited since 'set' is a predefined variable.
|
||||
@@ -5,12 +5,12 @@ Function: get_card_styling
|
||||
|
||||
Get the styling data of a [[type:card]].
|
||||
|
||||
This is for use in exporter scripts. In card scripts, use the "styling" predefined variable instead.
|
||||
This is for use in exporter scripts. In card scripts, use the 'styling' predefined variable instead.
|
||||
|
||||
--Parameters--
|
||||
! Parameter Type Description
|
||||
| @input@ [[type:card]] The card you want to retrieve the styling data from.
|
||||
| @set@ [[type:set]] The set the card belongs to. In an exporter script, this can be omited since "set" is a predefined variable.
|
||||
| @set@ [[type:set]] The set the card belongs to. In an exporter script, this can be omited since 'set' is a predefined variable.
|
||||
|
||||
--Examples--
|
||||
> # Retrieve the value "is foil" from the card's styling options
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
Function: get_mse_locale
|
||||
|
||||
--Usage--
|
||||
> get_mse_locale()
|
||||
|
||||
Returns the name of the currently selected locale folder.
|
||||
@@ -0,0 +1,14 @@
|
||||
Function: has_link
|
||||
|
||||
--Usage--
|
||||
> has_link(card: card, "link type")
|
||||
|
||||
Inspects a given [[type:card]]'s links to find one of the given type.
|
||||
Returns true if such a link was found, false otherwise.
|
||||
|
||||
Note that this function does not check if the linked card exists in the set. For that, use get_card_from_link.
|
||||
|
||||
--Parameters--
|
||||
! Parameter Type Description
|
||||
| @input@ [[type:string]] The type of link we want to find.
|
||||
| @card@ [[type:card]] The card whose links we'll inspect.
|
||||
@@ -97,6 +97,8 @@ These functions are built into the program, other [[type:function]]s can be defi
|
||||
| [[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: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:built_in_image]] Return an image built into the program.
|
||||
@@ -106,6 +108,9 @@ These functions are built into the program, other [[type:function]]s can be defi
|
||||
| [[fun:add_card_to_set]] Add a [[type:card]] to a [[type:set]].
|
||||
| [[fun:get_card_styling]] Get the styling data of a [[type:card]].
|
||||
| [[fun:get_card_stylesheet]] Get the stylesheet of a [[type:card]].
|
||||
| [[fun:get_card_from_uid]] Find the [[type:card]] with the given uid.
|
||||
| [[fun:get_card_from_link]] Find a [[type:card]] that has the given link type to the given [[type:card]].
|
||||
| [[fun:has_link]] Determine if the given the given [[type:card]] has a link of the given type.
|
||||
|
||||
! HTML export <<<
|
||||
| [[fun:to_html]] Convert [[type:tagged text]] to html.
|
||||
@@ -118,6 +123,7 @@ These functions are built into the program, other [[type:function]]s can be defi
|
||||
|
||||
! Other functions <<<
|
||||
| [[fun:get_mse_version]] Get the MSE app version.
|
||||
| [[fun:get_mse_locale]] Get the name of the currently selected locale.
|
||||
| [[fun:get_mse_path]] Get the MSE app folder absolute path.
|
||||
| [[fun:trace]] Output a message for debugging purposes.
|
||||
| [[fun:assert]] Check a condition for debugging purposes.
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
Function: insert_image
|
||||
|
||||
--Usage--
|
||||
> insert_image(base_image: image, inserted_image: image, offset_x: coordinate, offset_y: coordinate, background_color: color)
|
||||
|
||||
Insert an image inside another image.
|
||||
|
||||
The inserted image can be put outside the bounds of the base image. The resulting image will be widened accordingly.
|
||||
|
||||
--Parameters--
|
||||
! Parameter Type Description
|
||||
| @base_image@ [[type:image]] Image that serves as the canvas
|
||||
| @inserted_image@ [[type:image]] Image inserted on top of the base image
|
||||
| @offset_x@ [[type:double]] Offset of insertion, horizontally, in pixels
|
||||
| @offset_y@ [[type:double]] Offset of insertion, vertically, in pixels
|
||||
| @background_color@ [[type:color]] Background color, optional, defaults to transparent
|
||||
|
||||
Reference in New Issue
Block a user