Add background image to library
Add font file to library
Create page style
Create text style
Create Float variables VARA-C
Define a page named "pageName" with style "pageStyle"
Create minus key which decrements VarA by 1 if greater than 1 then runs mathF
Create plus key which increments VarA by 1 if less than 9 then runs mathF
Create minus key which decrements VarB by 1 if greater than 1 then runs mathF
Create plus key which increments VarB by 1 if less than 9 then runs mathF
Create text entity for VARA
Create text entity for VARB
Create Text entity for + Calc VARC
Create Text entity for - Calc VARC
Create Text entity for * Calc VARC
Create Text entity for / Calc VARC
Create Text entity for % Calc VARC
Create mathF
Displays VARA and VARB
Does Calc VARA + VARB = VARC display at text1
Does Calc VARA - VARB = VARC display at text2
Does Calc VARA * VARB = VARC display at text3
Does Calc VARA / VARB = VARC display at text4
Does Calc VARA % VARB = VARC display at text5
Run mathF func
After loading show the page named "pageName"
|
LIB(background,"SDHC/bground.png");
LIB(asc_16b,"SDHC/asc_16b.fnt");
STYLE(pageStyle, Page) { image = background; }
STYLE(textStyle, Text) { font=asc_16b; col=mediumblue;}
VAR(VarA,5, FLT1);VAR(VarB,8, FLT1);VAR(VarC,0, FLT1);
PAGE(pageName, pageStyle)
{
KEY(varAminus,[IF(VarA>1?[CALC(VarA,VarA,1,"-");]); RUN(mathF);],60,60,TOUCHR,35,100);
KEY(varAplus,[IF(VarA<9?[CALC(VarA,VarA,1,"+");]); RUN(mathF);],60,60,TOUCHR,135,100);
KEY(varBminus,[IF(VarB>1?[CALC(VarB,VarB,1,"-");]); RUN(mathF);],60,60,TOUCHR,35,200);
KEY(varBplus,[IF(VarB<9?[CALC(VarB,VarB,1,"+");]); RUN(mathF);],60,60,TOUCHR,135,200);
TEXT(Text0A,"",textStyle, 85, 100);
TEXT(Text0B,"",textStyle, 85, 200);
TEXT(Text1,"",textStyle, 320, 90);
TEXT(Text2,"",textStyle, 320, 130);
TEXT(Text3,"",textStyle, 320, 170);
TEXT(Text4,"",textStyle, 320, 210);
TEXT(Text5,"",textStyle, 320, 250);
}
FUNC(mathF)
{
TEXT(Text0A,VarA);TEXT(Text0B,VarB);
CALC(VarC,VarB,VarA,"+");TEXT(Text1,VarC);
CALC(VarC,VarB,VarA,"-");TEXT(Text2,VarC);
CALC(VarC,VarB,VarA,"*");TEXT(Text3,VarC);
CALC(VarC,VarB,VarA,"/");TEXT(Text4,VarC);
CALC(VarC,VarB,VarA,"%");TEXT(Text5,VarC);;
}
RUN(mathF);
SHOW(pageName);
|