Tutorial: film-files for showing a simple film
==============================================

Example for a film showing a house and a cloud passing by.
To run this film, use tut-film1.c.
The film is located in "film/film-2/" with name "film.film".


film.film
This is the main film-file. It defines the picture-files of which
this film consists.

==>
At first we have to declare, that this is the main film-file, and
the looping time in milliseconds, here 40 milliseconds:
[FILM 40]

We load the 1. picture-file, which shows a house.
We don't want to repeat it showing, therefore set
the <number of repeats> to 1.
The picture-file is located in the same directory as film.film.
1 film.pic1

Now we show the cloud passing by,
using the repeat mechanism, which sets variable $0 to the repeat-value
(here from 1 to 420), and we pass a parameter, which expands to variable $1,
with a value of -45, using it for the start value of the cloud.
420 film.pic2 -45      # para1=x-start of cloud
<== film.pic1 This is the first picture-file, loaded from film.film ==>
We want to show this picture for 100 loops, each loop lasting 40 milliseconds
as defined in film.film, so this picture is shown for 4 seconds.
loop(100)

At first we clear the window with color-index=0
clear(0)

Now we load ../bitmaps/house.vga (relative to file film.pic1)
and show it at its center of (200,130).
bitmap(200,130,trans) ../bitmaps/house.vga
<== film.pic2 This is the second picture-file, loaded from film.film ==>
At first we clear the window with color-index=0
clear(0)

We show again ../bitmaps/house.vga
bitmap(200,130,trans) ../bitmaps/house.vga

Now it is tricky, we show the cloud.
Because this picture-file film.pic2 is shown repeatedly 420 times,
we can move the cloud every time a bit forward, using parameter $0
(1 to 420) and the passed parameter $1 (=-45).
We simply add $0 to $1 for the x-position,
(in the formula we may use + - * / % ()).
bitmap($1+$0,35,trans) ../bitmaps/cloud.vga
<== Running the film When you run the film, you also will see our debug output. There are 3 numbers: - the first represents the current (non-comment) line of film.film - the second represents the current value of $0 (number of repeat) - the third represents the loop number of the picture-file The film-files film/film-2/film.film film/film-2/film.pic1 film/film-2/film.pic2
[Previous] - [Index] - [Next]