Create a library with the background image
Create a libraries with images for animation
We use here bmp files and
to hide the background we set the proper background colour.
These files have numbers as names. To create a good animation you have to keep appropriate order in file names.
When we have proper images we can create the loop wich will load images to IMG entity and refresh the page.
In this way we can get animation.
To create this functionality we need to use to variables, loop one conditional and some calculation.
Create the number variable "num" - we use it to calculate the current image number.
Create the pointer variable which allow us to create proper name for each image .
Create a style for page with the image as background
Create a style for image - alignment to center.
Define a page named "pageName" with style "pageStyle"
Set current position to X=240px, Y=136px
Create image entity named "image1" with "atr1" as image
Create endless loop 'animation'
Load to the pointer variable the name for the next image
Reload image entity 'image1' with new image name from pointer, two semicolons refresh (redraw) the page
Check if the number not exceed 17 and increase the number or reload it with 1
Wait 45ms
After loading show the page named "pageName"named "pageName"
|
LIB(background,"SDHC/bground.png");
LIB(atr17, "SDHC/17.bmp?back=\\ffffff");
LIB(atr16, "SDHC/16.bmp?back=\\ffffff");
LIB(atr15, "SDHC/15.bmp?back=\\ffffff");
LIB(atr14, "SDHC/14.bmp?back=\\ffffff");
LIB(atr13, "SDHC/13.bmp?back=\\ffffff");
LIB(atr12, "SDHC/12.bmp?back=\\ffffff");
LIB(atr11, "SDHC/11.bmp?back=\\ffffff");
LIB(atr10, "SDHC/10.bmp?back=\\ffffff");
LIB(atr9, "SDHC/9.bmp?back=\\ffffff");
LIB(atr8, "SDHC/8.bmp?back=\\ffffff");
LIB(atr7, "SDHC/7.bmp?back=\\ffffff");
LIB(atr6, "SDHC/6.bmp?back=\\ffffff");
LIB(atr5, "SDHC/5.bmp?back=\\ffffff");
LIB(atr4, "SDHC/4.bmp?back=\\ffffff");
LIB(atr3, "SDHC/3.bmp?back=\\ffffff");
LIB(atr2, "SDHC/2.bmp?back=\\ffffff");
LIB(atr1, "SDHC/1.bmp?back=\\ffffff");
VAR(num,17,U8);
VAR(atrptr>"",PTR);
STYLE(pageStyle, Page) { image = background; }
STYLE(imageStyle, Image) { curRel=CC;}
PAGE(pageName, pageStyle)
{
POSN(240, 136);
IMG(image1,atr1,imageStyle);
LOOP(animation,FOREVER)
{
LOAD(atrptr>"atr",num);
IMG(image1,atrptr);;
IF(num<17?[CALC(num,num,1,"+");]:[LOAD(num,1);]);
WAIT(45);
}
}
SHOW(pageName);
|