Add background image to library
Add MoveImg image to Library removing all red pixels
Create a style for page with the image as background
Create a style for the image
Create a variable for X position
Create a variable for Y position
Define a page named "pageName" with style "pageStyle"
Create image entity positioned at Variable XPosn, YPosn
Create Left Key that runs LeftF
Create Right Key that runs RightF
Create Up Key that runs an inline function that checks
if YPosn > 56 and if so takes 10 of YPosn and then
repositions the image to the new YPosn variable
Create Down Key that runs an inline function that checks
if YPosn < 216 and if so adds 10 to YPosn and then
repositions the image to the new YPosn variable.
Create LeftF that checks if XPosn > 180 and if so takes
10 off YPosn and then repositions the image to the new
XPosn variable.
Creaye RightF that checks if XPosn < 450 and if so adds
10 to XPosn and then repositions the image to the new
XPosn variable.
After loading show the page named "pageName"
|
LIB(background,"SDHC/bground.png");
LIB(MoveImg,"SDHC/MoveImg.bmp?back=\\ff0000");
STYLE(pageStyle,Page){image=background;}
STYLE(imageStyle,Image) {curRel=CC;}
VAR(XPosn,240,U16);
VAR(YPosn,136,U16);
PAGE(pageName, pageStyle)
{
IMG(image1,MoveImg,imageStyle,XPosn,YPosn);
KEY(LeftK,LeftF,50,30,TOUCHR,40,200);
KEY(RightK,RightF,50,30,TOUCHR,100,200);
KEY(UpK,[IF(YPosn>56?[CALC(YPosn,YPosn,10,"-");]); POSN(XPosn,YPosn,image1);;],50,30,TOUCHR,70,160);
KEY(DownK,[IF(YPosn<216?[CALC(YPosn,YPosn,10,"+");]); POSN(XPosn,YPosn,image1);;],50,30,TOUCHR,70,240);
}
FUNC(LeftF)
{
IF(XPosn>180?[CALC(XPosn,XPosn,10,"-");]);
POSN(XPosn,YPosn,image1);;
}
FUNC(RightF)
{
IF(XPosn<450?[CALC(XPosn,XPosn,10,"+");]);
POSN(XPosn,YPosn,image1);;
}
SHOW(pageName);
|