Commit ebc5cbcb authored by twanvl's avatar twanvl

And the documentation just keeps comming...

parent 74ded82e
......@@ -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: <em>filename</em>
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
......
......@@ -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]]
......
Style triangle
<img src="style-triangle.jpg" style="float:right;" alt=""/>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]]
......@@ -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
......
Scripting language
MSE uses a custom scripting language to add complicated behaviour to fields and styles.
==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, <span style="border:1px solid black; background:white;width:20px;"> </span>
| @rgb(0,0,0)@ black, <span style="border:1px solid black; background:white;width:20px;"> </span>
| @rgb(255,0,0)@ red, <span style="border:1px solid black; background:red;width:20px;"> </span>
| @rgb(0,255,0)@ green, <span style="border:1px solid black; background:green;width:20px;"> </span>
| @rgb(0,0,255)@ blue, <span style="border:1px solid black; background:blue;width:20px;"> </span>
! Code Represents <<<
| @rgb(255,255,255)@ white <div style="border:1px solid black; background:white;width:30px;height:15px;"> </div>
| @rgb(0,0,0)@ black <div style="border:1px solid black; background:black;width:30px;height:15px;"> </div>
| @rgb(255,0,0)@ red <div style="border:1px solid black; background:red; width:30px;height:15px;"> </div>
| @rgb(0,255,0)@ green <div style="border:1px solid black; background:rgb(0,255,0);width:30px;height:15px;"> </div>
| @rgb(0,0,255)@ blue <div style="border:1px solid black; background:blue; width:30px;height:15px;"> </div>
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
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
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.
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 <tt>.mse-include</tt> file extension.
It should contain a [[file:format|data file]] called <tt>include</tt> 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.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment