diff --git a/doc/file/format.txt b/doc/file/format.txt index 884704e4..181a4f0a 100644 --- a/doc/file/format.txt +++ b/doc/file/format.txt @@ -21,6 +21,19 @@ When the value is longer then a single line it can be written indented on the fo > T: Draw a card > WW: Gain 1 life +--Order-- + +Usually the order in which keys appear in a file doesn't matter. +However some keys, like @mse version@ and @type@ must come first because they influence how the following keys are interpreted. + +--Includes-- + +A heirachical file can contain a reference to another file: +>>>include file: filename +Where filename must be an absolute [[type:filename]]. + +That file is included literally into the current one; except for indentation, the included file never escapes from the level the 'include file' line is on. + --Example-- For example, a [[type:set]] might look like this: >game: magic diff --git a/doc/file/index.txt b/doc/file/index.txt index 0b877ba7..dd773ae1 100644 --- a/doc/file/index.txt +++ b/doc/file/index.txt @@ -9,6 +9,7 @@ The following types are stored in [[file:package]]s in the: * [[type:symbol font]] * [[type:export template]] * [[type:locale]] +* [[type:include]] The following types are stored in [[file:package]]s that can be located anywhere: * [[type:set]] diff --git a/doc/file/style-triangle.jpg b/doc/file/style-triangle.jpg new file mode 100644 index 00000000..3988c6ad Binary files /dev/null and b/doc/file/style-triangle.jpg differ diff --git a/doc/file/style_triangle.txt b/doc/file/style_triangle.txt new file mode 100644 index 00000000..e20569e5 --- /dev/null +++ b/doc/file/style_triangle.txt @@ -0,0 +1,19 @@ +Style triangle + +A central idea of MSE is the separation of data and styling. + +Consider a single card, say "Forest". +This card could be printed in an old set, for example Fifth Edition, using an old style frame. +The ''same'' card can also be put into a new fram in for instance Ninth Edition. + +So the card (the data) is independent of the style, but both are based on the same game (description), i.e. Magic. + +This distinction is made on two levels. +The three different types of packages, [[type:game]], [[type:stylesheet]] and [[type:set]]. +They contain three different things, [[type:field]]s, [[type:style]]s and [[type:value]]s. + +This is illustrated in the diagram on the right and in the following table. +| Description Looks Data +| High level [[type:Game]] [[type:Stylesheet]] [[type:Set]] +| [[type:Card]] +| Low level [[type:Field]] [[type:Style]] [[type:Value]] diff --git a/doc/function/symbol_variation.txt b/doc/function/symbol_variation.txt index 0d60d65c..58b39c36 100644 --- a/doc/function/symbol_variation.txt +++ b/doc/function/symbol_variation.txt @@ -9,7 +9,7 @@ The variation name refers to one of the varations declared in the [[type:style]] > symbol_variation(symbol: symbol_value, border_radius: .., fill_type: .., ...) Render a custom variation of a symbol. -Additional parameters corresponding to the properties of a [[type:symbol filter]] must be present. +Additional parameters corresponding to the properties of a [[type:symbol variation]] must be present. --Parameters-- ! Parameter Type Description diff --git a/doc/script/index.txt b/doc/script/index.txt index 40e44c6b..9d5296f0 100644 --- a/doc/script/index.txt +++ b/doc/script/index.txt @@ -1,2 +1,4 @@ Scripting language +MSE uses a custom scripting language to add complicated behaviour to fields and styles. + diff --git a/doc/script/operators.txt b/doc/script/operators.txt index e69de29b..444a2d3d 100644 --- a/doc/script/operators.txt +++ b/doc/script/operators.txt @@ -0,0 +1,2 @@ +Operators + diff --git a/doc/type/color.txt b/doc/type/color.txt index ba302a84..f1821ac5 100644 --- a/doc/type/color.txt +++ b/doc/type/color.txt @@ -1,4 +1,4 @@ -==Data type: color== +Primitive type: color --Syntax-- In files and scritps a color can be represented as @@ -7,9 +7,9 @@ where red_component, green_component and blue_component are numbers between 0 an --Examples-- For example: -! Code Represents -| @rgb(255,255,255)@ white, -| @rgb(0,0,0)@ black, -| @rgb(255,0,0)@ red, -| @rgb(0,255,0)@ green, -| @rgb(0,0,255)@ blue, +! Code Represents <<< +| @rgb(255,255,255)@ white
+| @rgb(0,0,0)@ black
+| @rgb(255,0,0)@ red
+| @rgb(0,255,0)@ green
+| @rgb(0,0,255)@ blue
diff --git a/doc/type/dependency.txt b/doc/type/dependency.txt index e69de29b..b65a7615 100644 --- a/doc/type/dependency.txt +++ b/doc/type/dependency.txt @@ -0,0 +1,17 @@ +Data type: dependency + +--Overview-- + +[[type:Package]]s can depend on other packages. +For example a [[type:stylesheet]] needs a particular version of the corresponding [[type:game]] package, and maybe some additional [[type:include]]s. + +--Proeprties-- +! Property Type Description +| @package@ [[type:string]] Filename of the package this package depends on. +| @version@ [[type:version]] Minimal version of that package that is required. + +--Example-- +The magic-new stylesheet depends on a particular version of the game file: +>depends on: +> package: magic.mse-game +> version: 2007-06-06 diff --git a/doc/type/function.txt b/doc/type/function.txt index e69de29b..271fc643 100644 --- a/doc/type/function.txt +++ b/doc/type/function.txt @@ -0,0 +1,18 @@ +Primitive type: function + +--Overview-- +The [[script:index|scripting language]] allows you to define custom functions. + +--Syntax-- +A piece of code enclosed in curly braces defines a function. + +--Composition-- +Functions can be composed using the @+@ operator, evaluating @a + b@ first evaluates @a@ and uses its result as @input@ for @b@: +> example := to_upper + { "result == {input}" } +> example("xyz") == "result == XYZ" + +Multiple functions can be changed together like this, especially using [[script:rule form]]. + +--Example-- +> example := { a + b } +> example(a: 1, b: 2) == 3 diff --git a/doc/type/image.txt b/doc/type/image.txt index e69de29b..b28eb775 100644 --- a/doc/type/image.txt +++ b/doc/type/image.txt @@ -0,0 +1,28 @@ +Primitive type: image + +Images are generated using scripts. + +It is either given using a [[type:filename]] or as the output of a function. + +--File syntax-- +The syntax for files is similair to that of [[type:scriptable]] properties: +> image: image.png +> image: { "image.png" } +> image: { linear_blend(...) } + +--Script syntax-- +[[type:Filename]]s are implicitly converted to images as needed. + +--See also-- +The following functions transform images: +| [[fun:linear_blend]] Blend two images together using a linear gradient. +| [[fun:masked_blend]] Blend two images together using a third mask image. +| [[fun:combine_blend]] Blend two images together using a given [[type:combine|combining mode]]. +| [[fun:set_mask]] Set the transparancy mask of an image. +| [[fun:set_alpha]] Change the transparency of an image. +| [[fun:set_combine]] Chnage how the image should be combined with the background. +| [[fun:enlarge]] Enlarge an image by putting a border around 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. diff --git a/doc/type/include.txt b/doc/type/include.txt index e69de29b..d8d79f82 100644 --- a/doc/type/include.txt +++ b/doc/type/include.txt @@ -0,0 +1,22 @@ +File type: Include package + +--Overview-- + +An include package contains files used by other packages, for example scripts or images. + +--Package format-- +An include package is described in a [[file:package]] with the .mse-include file extension. +It should contain a [[file:format|data file]] called include with the following properties. + +--Properties-- +! Property Type Default Description +| '''Common to all packages''' <<< <<< <<< +| @mse version@ [[type:version]] ''required'' Version of MSE this include package is made for. +| @short name@ [[type:string]] file name A short name of this include package, currently not used. +| @full name@ [[type:string]] file name A longer name of this include package, currently not used. +| @icon@ [[type:filename]] ''none'' Filename of an icon / preview for this export template, currently not used. +| @version@ [[type:version]] @0.0.0@ Version number of this package. +| @depends on@ [[type:list]] of [[type:dependency]]s + Packages this package depends on. + +No additional properties are available.