geissclk 0.02: BTN2->launcher, use smaller text to allow "20:00" to fit on screen
parent
64d379432d
commit
a1454a9d85
|
|
@ -285,7 +285,7 @@
|
||||||
{ "id": "geissclk",
|
{ "id": "geissclk",
|
||||||
"name": "Geiss Clock",
|
"name": "Geiss Clock",
|
||||||
"icon": "clock.png",
|
"icon": "clock.png",
|
||||||
"version":"0.01",
|
"version":"0.02",
|
||||||
"description": "7 segment clock with animated background in the style of Ryan Geiss' music visualisation. NOTE: The first run will take ~1 minute to do some precalculation",
|
"description": "7 segment clock with animated background in the style of Ryan Geiss' music visualisation. NOTE: The first run will take ~1 minute to do some precalculation",
|
||||||
"tags": "clock",
|
"tags": "clock",
|
||||||
"type":"clock",
|
"type":"clock",
|
||||||
|
|
@ -2792,7 +2792,7 @@
|
||||||
{ "id": "testuserinput",
|
{ "id": "testuserinput",
|
||||||
"name": "Test User Input",
|
"name": "Test User Input",
|
||||||
"shortName":"Test User Input",
|
"shortName":"Test User Input",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"version":"0.03",
|
"version":"0.03",
|
||||||
"description": "Basic app to test the bangle.js input interface. It displays the user action in text or an on/off switch image for swipe movement.",
|
"description": "Basic app to test the bangle.js input interface. It displays the user action in text or an on/off switch image for swipe movement.",
|
||||||
"readme": "README.md",
|
"readme": "README.md",
|
||||||
|
|
|
||||||
|
|
@ -1 +1,2 @@
|
||||||
0.01: New App!
|
0.01: New App!
|
||||||
|
0.02: BTN2->launcher, use smaller text to allow "20:00" to fit on screen
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,10 @@ var compiled = (function(){
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
require("Font7x11Numeric7Seg").add(Graphics);
|
//require("Font5x9Numeric7Seg").add(Graphics);
|
||||||
|
Graphics.prototype.setFont5x9Numeric7Seg = function() {
|
||||||
|
this.setFontCustom(atob("AAAAAAAAAAIAAAQCAQAAAd0BgMBdwAAAAAAAdwAB0RiMRcAAAERiMRdwAcAQCAQdwAcERiMRBwAd0RiMRBwAAEAgEAdwAd0RiMRdwAcERiMRdwAFAAd0QiEQdwAdwRCIRBwAd0BgMBAAABwRCIRdwAd0RiMRAAAd0QiEQAAAAAAAAAA="), 32, atob("BgAAAAAAAAAAAAAAAAYCAAYGBgYGBgYGBgYCAAAAAAAABgYGBgYG"), 9);
|
||||||
|
}
|
||||||
|
|
||||||
// Allocate the data
|
// Allocate the data
|
||||||
var dataa = new Uint8Array(W*H);
|
var dataa = new Uint8Array(W*H);
|
||||||
|
|
@ -92,7 +95,7 @@ var lastSeconds = -1;
|
||||||
|
|
||||||
function iterate() { "ram"
|
function iterate() { "ram"
|
||||||
var d = new Date();
|
var d = new Date();
|
||||||
var time = d.getHours().toString().padStart(2," ")+":"+d.getMinutes().toString().padStart(2,0);
|
var time = require("locale").time(d,1);
|
||||||
var seconds = d.getSeconds().toString().padStart(2,0);
|
var seconds = d.getSeconds().toString().padStart(2,0);
|
||||||
t = addra; addra = addrb; addrb = t;
|
t = addra; addra = addrb; addrb = t;
|
||||||
t = dataa; dataa = datab; datab = t;
|
t = dataa; dataa = datab; datab = t;
|
||||||
|
|
@ -117,10 +120,11 @@ function iterate() { "ram"
|
||||||
compiled.transl(addrmap, addra, addrb);
|
compiled.transl(addrmap, addra, addrb);
|
||||||
|
|
||||||
|
|
||||||
gfx.setFont("7x11Numeric7Seg",2);
|
x = 8;
|
||||||
gfx.drawString(time, -5, 20);
|
gfx.setFont("5x9Numeric7Seg",2);
|
||||||
gfx.setFont("7x11Numeric7Seg");
|
gfx.drawString(time, x, 20);
|
||||||
gfx.drawString(seconds, 62, 30);
|
gfx.setFont("5x9Numeric7Seg");
|
||||||
|
gfx.drawString(seconds, x+55, 30);
|
||||||
// firmwares pre-2v09 wouldn't accelerate a 3x blit if it went right to the RHS - hence we're 79px not 80
|
// firmwares pre-2v09 wouldn't accelerate a 3x blit if it went right to the RHS - hence we're 79px not 80
|
||||||
g.drawImage(im,1,24,{scale:3});
|
g.drawImage(im,1,24,{scale:3});
|
||||||
}
|
}
|
||||||
|
|
@ -143,3 +147,5 @@ Bangle.loadWidgets();
|
||||||
Bangle.drawWidgets();
|
Bangle.drawWidgets();
|
||||||
iterate();
|
iterate();
|
||||||
animInterval = setInterval(iterate, 50);
|
animInterval = setInterval(iterate, 50);
|
||||||
|
|
||||||
|
setWatch(Bangle.showLauncher, BTN2, {repeat:false,edge:"falling"});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue