2. MND Script
2.1. Single-values
2.2. Default value
2.3. Multi-values
2.4. Coordinates
2.5. Command parameters
2.6. Target, shower and local area
2.7. Timing
2.8. Nested projects
3. Directives Reference
3.1. @@C - Set Project Caption
3.2. @@T - Set Project Time
3.3. @@R - Set Project Resolution
4. Commands Reference
4.1. @C - Fill with Color
4.2. @I - Show Image
4.3. @S - Render Scene Frame(s)
4.4. @D - Render Project Frame(s)
4.5. @M - Play Music
4.6. @T - Print Text
5. Parameters Reference
5.1. Blending modes
5.2. Wrapping modes
@@X <parameters>
where X can be any letter.|
@@T 0:100 @@R 1600 1200 |
@X <mandatory-parameters> <optional-parameters>
where X can be any letter, mandatory parameters have to be present always, andEach command creates one shower for that command. Shower is responsible
for
interpreting parameters of commands and executing that command.
Every command
has one corresponing shower type. There are exectly as
many showers as there
are commands in the project script.
| @C 0:300 $FF $FF $FF |
| @@T 0:300 ; this project starts at 0th and ends at 300th second |
MND Script
* default value: ?
- this denotes default value for parameter
* normal value: <number>
- this is normal floating point or integer number
Numbers can be signed (have + or - before digits). Scientific notation (like
1.0E-3) is not supported for floating point numbers. Integer
numbers can be
specified in hexadecimal notation when $ is written
before hexadecimal digits.
|
100 -0.5 $fA98 |
For example, default project resolution is 800x600. So, instead of
| @@R 800 600 |
| @@R ? ? |
| @@R 800 ? |
| @@R ? 600 |
All four combinations will have exactly same final effect.
Multi-valuesInstead of a multi-value, you can always use single-value (default or normal).
Multi-value starts with [ and ends with ]. Between brackets, you
specify
keyframes (much like keyframes in Lightwave) - time and value
for each keyframe
in the form TIME:VALUE and you separate keyframes
with commas. Here are some
simple examples:
| [0:1, 10:5] means: |
You can also specify more than one keyframe:
|
[0:1, 10:5, 20:1] [-20:1, -10:0, 0:1, +10:0, +20:1] |
Note that time can be either ordinary floating point number or default
value.
Default value of time for any keyframe is length of local time
(see section
Timing for explanation of local time).
As for value of any keyframe, you can use any single-value (default or normal).
Multi-values can be repeated/looped. You can do this by putting ! after
the
last keyframe and before ]. In this case, behavior of multi-value
is repeated
after the last keyframe. So, if you have multi-value
| [0:1, 10:5, 20:1 !] |
| [-10:0, 0:1, +10:0 !] |
| [0:0, 10:10, 20:20, 30:10 ! 10] |
There is one more thing you can do with multi-value. Imagine that you
want to
have value of some to be 1 from 0s to 10s and 2 from 10s to
20s. Something like:
| [0:1, 10:1] combined with [10:2, 20:2] |
As you can see, the only problematic place is 10s, where you have some
kind of
jump from 1 to 2. It is possible to have this behaviour in easy
way:
| [0:1, 10:1:2, 20:2] |
You can think of this as an abbrivation for two multi-values above.
Note that
you can "combine" more than two multi-values:
| [0:1, 10:1:2, 20:2:3, 30:3:4, 40:4] |
Coordinates are relative to the upper left corner, which means (0,0)
indicates
upper left corner of the screen.
Examples:
|
0 0 = left upper corner of the screen 400 300 = center of the screen 100 75 = 100th pixel horizontally, at the 1/4 vertically |
At the time, one parameter can be entered multiple times in which case
behavior of the program will be valid but undefined.
- at the beginning of each frame, target area is set to full screen
- parameter P of command @D denotes new target area
- parameter S of command @D sets proportions of target area
Target area is not limited to the size of image (or screen), it can be
larger
in which case everything outside visible area is clipped.
Shower area is part of target area on which shower renders its command.
Shower
area is not limited to target area, but only those parts inside
target area
will be rendered, everything else will be clipped.
Local area is part of the source of the command which is rendered to
shower
area. Usually, size of local and shower area are same. They
differ in some
situations like when part of image (or whole image) is
stretched to shower
area which means it's not anymore in original
proportions.
All commands in script have time which tells when they are "active".
Outside
this range, commands are not being executed, and nothing is
rendered (or heard,
in case of sounds). This time is called 'shower
time'.
Shower times must fall inside project time, and for each command,
starting time
must be less than or equal to ending time. Default value
for shower starting
time is project starting time, and default value
for shower ending time is
project ending time.
Inside one command for shower, all times are written in local time.
Local time
for every shower is 0 at shower starting time and lasts for
as long as shower.
For example, if shower time is 30:75, then its local
time is 0:45 (45 = 75-30).
Examples:
|
; project time is 0:100 @@T 100 ; shower time is 0:100, local time is 0:100 @I 0:100 background.jpg ; shower time is 45:100, local time is 0:55 @I 45:100 title2.jpg |
- if some project is rendered, then current time of that project
is picked for
rendering
- otherwise, time since application started is picked as current time
for
nested project rendering
Nested projects are created in following way: Let's say that we have
image
called TEXTURE.JPG. Now, if we create project TEXTURE.JPG.MND,
then contents of
this project will be used instead of image
TEXTURE.JPG. After we create the
project, original image (TEXTURE.JPG)
doesn't have to exist anymore. Also note
that image can be in any
format, not only JPEG.
Target image rendered in this way can be used as any other image (all
properties of surface regarding way the image is rendered apply to it,
all
parameters of command @I...). It is ordinary image like any other
after it is
rendered.
Note that every target image is rendered only once per application
frame. So,
if you have same target image used as a texture on two
objects, it will be
rendered only once.
Also, be careful when using nested project because you can get
strange effects
like in this situation:
|
=== NESTED.PNG.MND === ; animate from black to red @@R 800 600 @@T 10 @C 0:? [0:0, ?:255] 0 0 |
|
=== TEST_INNER.MND === ; render nested project and show target image @@R 800 600 @@T 10 @I 0:? NESTED.PNG P 0 0 800 600 |
|
=== TEST.MND === @@R 800 600 @@T 10 ; left part of the screen: animate from black to red @D 0:? TEST_INNER.MND T [0:0, ?:1] P 0 0 400 600 ; right part of the screen: animate from red to black @D 0:? TEST_INNER.MND T [0:1, ?:0] P 400 0 400 600 |
But, you will not get desired effect. Both left and right side of the
screen
will animate from black to red because they use same target
image (NESTED.MND).
To have correct behaviour, you will need to create
NESTED2.MND. So, create
TEST_INNER2.MND and modify TEST.MND:
|
=== NESTED2.MND === (same as NESTED.MND) @@R 800 600 @@T 10 @C 0:? [0:0, ?:255] 0 0 |
|
=== TEST_INNER2.MND === (almost same as TEST_INNER.MND) @@R 800 600 @@T 10 @I 0:? NESTED2.PNG P 0 0 800 600 |
|
=== TEST.MND === (almost sam as original TEST.MND) @@t 800 600 @@T 10 @D 0:? TEST_INNER.MND T [0:0, ?:1] P 0 0 400 600 @D 0:? TEST_INNER2.MND T [0:1, ?:0] P 400 0 400 600 |
Directives Reference
Description
This directive sets caption of the project. This caption is used
when project is played directly in NORD.
Default value
@@C <name-of-MND-file>
Example:
| @@C "Frozen Lands" |
Description
This directive sets starting and ending time for animation. In the
first
case, when there is not <starttime>, it is assumed to be 0.
Ending time must be greater than starting time.
This directive is mandatory, and has to be set before any command in the
script.
Default value,
None. This directive is mandatory.
Examples
|
@@T 100 @@T -1:+1 |