Documented add cards scripts and the new_card function

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1149 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2008-08-11 21:10:59 +00:00
parent 99b07668ec
commit fe5878e3d8
6 changed files with 66 additions and 1 deletions
+4 -1
View File
@@ -79,11 +79,14 @@ These functions are built into the program, other [[type:function]]s can be defi
| [[fun:set_combine]] Change how the image should be combined with the background.
| [[fun:saturate]] Saturate/desaturate an image.
| [[fun:enlarge]] Enlarge an image by putting a border around it.
| [[fun:crop]] Crop an image, giving only a small subset of it.
| [[fun:crop]] Crop an image, giving only a small subset of it.
| [[fun:drop_shadow]] Add a drop shadow to an image.
| [[fun:symbol_variation]] Render a variation of a [[type:symbol]].
| [[fun:built_in_image]] Return an image built into the program.
! Cards <<<
| [[fun:new_card]] Construct a new [[type:card]] object.
! HTML export <<<
| [[fun:to_html]] Convert [[type:tagged text]] to html.
| [[fun:symbols_to_html]] Convert text to html using a [[type:symbol font]].
+25
View File
@@ -0,0 +1,25 @@
Function: new_card
--Usage--
> new_card(map_of_field_names_to_values)
Create a new [[type:card]] object not already in the set.
The argument is a map of values to set, for example @new_card([name: "My Card"])@ creates a card with the name @"My Card"@, and all other fields at their default value.
NOTE: you should use underscores instead of spaces in field names.
--Parameters--
! Parameter Type Description
| @input@ [[type:map]] of field names to field values Field values to set
--Examples--
> # Create a new card
> my_card := new_card(
> [ name: "My Card"
>> , type: "Super cool"
>> , rule_text: "This card is <i>mine</i>!"
> ])
>
> # Write an image of the card to a file
> write_image_file(my_card, file: "my_card.jpg")