Add background image to library
Create a style for page with the image as background
Create a style for the text entity - font Ascii16, color black
Create a style for the date variable format with jS F Y
(see RTC for more format info)
Create a style for the time variable format H:i:s (see
RTC for more format info)
Define variable "TimeVar".
Define variable "DateVar".
Define interrupt "TimeL", each second triggers function "UpdateT"
on CNTMILLI which is miliseconds counter and it triggers interrupt each 1000 ms.
Define a page named "pageName" with style "pageStyle"
Set current position to X=140 Y=122
Create Text entity which will show DateVar
Create Text entity which will show TimeVar
Create UpdateT function which is called on interupt.
Loads RTC value into TimeVar which is the formated variable
Loads RTC value into DateVar which is the formated
variable
Load TimeVar and DateVar into their respective text
entities and refresh.
Run UpdateT after loading page
After loading show the page named "pageName"
|
LIB(background,"SDHC/bground.png");
STYLE(pageStyle, Page) { image = background; }
STYLE(textStyle, Text) {font = Ascii16; col = Black; }
STYLE(dateStyle,Data) {type=text; length=30; format="jS F Y"; }
STYLE(timeStyle,Data) {type=text; length=8; format="H:i:s"; }
VAR(TimeVar,"",timeStyle);
VAR(DateVar,"",dateStyle);
INT(TimeL,CNTMILLI,UpdateT);
PAGE(pageName, pageStyle)
{
POSN(140,122);
TEXT(DateT,DateVar,textStyle);
POSN(140,150);
TEXT(TimeT,TimeVar,textStyle);
}
FUNC(UpdateT)
{
LOAD(TimeVar,RTC);
LOAD(DateVar,RTC);
TEXT(TimeT,TimeVar);
TEXT(DateT,DateVar);;
}
RUN(UpdateT);
SHOW(pageName);
|