mirror of
https://github.com/espruino/Espruino.git
synced 2025-12-08 19:06:15 +00:00
2 lines
602 B
JavaScript
2 lines
602 B
JavaScript
(function(e,a){"string"==typeof a&&(a={title:a});a=a||{};g.clearRect(Bangle.appRect);g.reset().setFont("6x8",128<g.getWidth()?2:1).setFontAlign(0,-1);var c=Bangle.appRect.y,b=g.getWidth(),d=g.getHeight()-c,k=g.getFontHeight(),f=g.wrapString(a.title,b-2);e=g.wrapString(e||"",b-2);d=c+(d+(f.length-e.length)*k)/2;if(a.img){var h=g.imageMetrics(a.img);g.drawImage(a.img,(b-h.width)/2,d-h.height/2);d+=4+h.height/2}g.drawString(e.join("\n"),b/2,d);a.title&&g.setColor(g.theme.fgH).setBgColor(g.theme.bgH).clearRect(0,
|
|
c,b-1,c+4+f.length*k).drawString(f.join("\n"),b/2,c+2);g.flip();Bangle.setLCDPower(1)}) |