Merge pull request #164 from Purple-Tentacle/master

Pipboy clock, changed colors and added date
master
Gordon Williams 2020-03-30 16:01:20 +01:00 committed by GitHub
commit 41cf7fbff2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 8 deletions

View File

@ -803,7 +803,7 @@
"id": "pipboy",
"name": "Pipboy",
"icon": "app.png",
"version": "0.01",
"version": "0.02",
"description": "Pipboy themed clock",
"tags": "clock",
"type":"clock",

2
apps/pipboy/ChangeLog Normal file
View File

@ -0,0 +1,2 @@
0.01: New Watch!
0.02: Changed colors for better readability and added current date

View File

@ -29,17 +29,23 @@ function topLine() {
function bottomLine() {
g.setColor(darkGreen);
g.fillRect(5, 175, 60, 185);
g.fillRect(67, 175, 140, 185);
//first line
g.setColor(darkerGreen);
g.fillRect(5, 175, 100, 185); //DATE
g.fillRect(105, 175, 160, 185);//STIM
g.fillRect(166, 175, 239, 185); // RADAWAY
g.setColor(green);
g.setFont("6x8", tinyFont);
g.drawString("DATE", 20, 177);
g.drawString("STIM (3)", 135, 177);
g.drawString("RADAWAY (8)", 205, 177);
//second line
g.setColor(darkerGreen);
g.fillRect(5, 190, 70, 200);
g.fillRect(75, 190, 239, 200);
g.setFont("6x8", tinyFont);
g.drawString("STIM (0)", 32, 177);
g.drawString("RADAWAY (0)", 105, 177);
g.setColor(green);
g.drawString("HP 115/115", 38, 192);
g.drawString("LEVEL 6", 100, 192);
@ -55,14 +61,26 @@ function drawClock() {
var t = new Date();
var h = t.getHours();
var m = t.getMinutes();
var dd = t.getDate();
var mm = t.getMonth()+1; //month is zero-based
var yy = t.getFullYear();
var time = ("0" + h).substr(-2) + ":" + ("0" + m).substr(-2);
//create date string
if (dd.toString().length < 2) dd = '0' + dd;
if (mm.toString().length < 2) mm = '0' + mm;
var date = dd + "." + mm + "." + yy;
g.setFont("6x8",bigFont);
g.setColor(green);
g.setFontAlign(0, -1, 0);
g.clearRect(0, 110, 150, 140);
g.drawString(time, 70, 110);
//draw date
g.setFont("6x8", tinyFont);
g.drawString(date, 67, 177);
}
function drawAll() {
@ -83,4 +101,3 @@ setInterval(drawClock, 1E4);
drawAll();
setWatch(Bangle.showLauncher, BTN2, {repeat:false,edge:"falling"});