/*
DrawText sample

[Working with]
Stickypaper 1.2.9 +

[Setting]
repeat=30sec - 60sec.


DrawText(text,x,y,fontsize,color_red,color_green,color_blue,color_alpha,fontname,width,height [,FontStyle] )  


FontStyle;
    FontStyleRegular = 0,
    FontStyleBold = 1,
    FontStyleItalic = 2,
    FontStyleBoldItalic = 3,
    FontStyleUnderline = 4,
    FontStyleStrikeout = 8


*/


weekstr=new Array('Sun,','Mon,','Tue,','Wed,','Thu,','Fri,','Sat,');
monthstr=new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
 



//init---------

Memo.width=400;
Memo.height=193;
Memo.Clear();




//date---------


Date.format="yyyy hh:nn";
s=weekstr[Date.getDay()] +' '+ Date.getDate()+' '+ monthstr[Date.getMonth()] +' '+ Date.toString();
Memo.DrawText( s,0,0,  24,  50,50, 50,255,   'Georgia',Memo.width,Memo.height,1|2);



Memo.text=s;




//message---------

Date.format="mm";
f=new Strings;
f.loadFromFile('data\'+Date.toString());
Date.format="dd";
list=f.text.match( "^"+Date.toString() +',(.+?)\n' ,'gm' );

if(list){
Memo.DrawText( list[  Math.floor(Date.getMinutes()/60*list.length)  ].replace('\d\d,','')   ,0,28,  10,  50,50, 50,255,   'Georgia',Memo.width,Memo.height,2);
Memo.text=Memo.text +"\n"+ list[  Math.floor(Date.getMinutes()/60*list.length)  ].replace('\d\d,','');
}



//update---------

Memo.Update();


