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 |
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 |
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 |