Fix date alignment and change font to closer match Rolex

pull/1524/head
DC959 2022-02-28 22:07:33 +13:00
parent 8518e7623f
commit 48d8fae37c
6 changed files with 22 additions and 8 deletions

View File

@ -1,3 +1,4 @@
0.01: Initial Release 0.01: Initial Release
0.02: Minor tweaks for light theme 0.02: Minor tweaks for light theme
0.03: Made images 2 bit and fixed theme honoring 0.03: Made images 2 bit and fixed theme honoring
0.04: Fixed date font alignment and changed date font to match a real Rolex

View File

@ -1,11 +1,13 @@
# Rolex # Rolex
![](screenshot.png) ![](screenshot.png) ![](screenshot1.png)
Created with the aid of the Espruino documentation and looking through many of the wonderful exising watchfaces that have been made. Created with the aid of the Espruino documentation and looking through many of the wonderful exising watchfaces that have been made.
This has not been tested on a watch yet as I haven't aquired one but has been tested in the emulator. This has not been tested on a watch yet as I haven't aquired one but has been tested in the emulator.
The hands don't rotate dead on center but they're as close as I could get them to. The hands don't rotate dead on center but they're as close as I could get them to.
Colour switches based on watch theme so if you want a white on black change your watch theme to dark, and for black on white change it to light.
Special thanks to: Special thanks to:
* rozek (for his updated widget draw code for utilization with background images) * rozek (for his updated widget draw code for utilization with background images)
* Gordon Williams (Bangle.js, watchapps for reference code and documentation) * Gordon Williams (Bangle.js, watchapps for reference code and documentation)

View File

@ -28,6 +28,14 @@ var imgSec = {
buffer : E.toArrayBuffer(atob("v/q//r/+v/qv+q/qq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qv+v/6/D/wD8PDw8PwD/w///6v+qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqr+r//v///X/1X/Vf9V/1X/1///+//q/qq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq6qrqg==")) buffer : E.toArrayBuffer(atob("v/q//r/+v/qv+q/qq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qv+v/6/D/wD8PDw8PwD/w///6v+qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqr+r//v///X/1X/Vf9V/1X/1///+//q/qq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq+qr6qvqq6qrqg=="))
}; };
/* use font closer to Rolex */
Graphics.prototype.setFontRolexFont = function(scale) {
// Actual height 12 (12 - 1)
this.setFontCustom(atob("AAAABAACAAAAAYAHgA4AOABgAAAAA/gD/gMBgQBAwGA/4A/gAAAAAAIBAQCB/8D/4AAQAAAAAAAAAwEDAYEBQIEgYxA/CA4MAAAAAAAAgIBAhCBCEDOYHvgCOAAAAAAABgANAAyAHEAf/A/+AAgABAAAAAAADBAcCBsECYIEYgIeAAAAAAAHwAfwB5wGggZBAjGBH4CDgAAACAAYAAgABAMCDwE+APgAYAAAAAAABxwH3wJwgRhA3iB54AhgAAAAAAPhA/iBDMCCQGHgH+AHwAAAAAAAQIAgQAAAAAA="), 46, atob("BAUJCQkJCQkJCQkJBQ=="), 17+(scale<<8)+(1<<16));
return this;
};
/* Set variables to get screen width, height and center points */ /* Set variables to get screen width, height and center points */
let W = g.getWidth(); let W = g.getWidth();
@ -36,10 +44,6 @@ let cx = W/2;
let cy = H/2; let cy = H/2;
let Timeout; let Timeout;
/* set font */
require("Font4x5Numeric").add(Graphics);
Bangle.loadWidgets(); Bangle.loadWidgets();
/* Custom version of Bangle.drawWidgets (does not clear the widget areas) Thanks to rozek */ /* Custom version of Bangle.drawWidgets (does not clear the widget areas) Thanks to rozek */
@ -106,9 +110,10 @@ function drawHands() {
g.drawImage(imgHour,cx-22*hourSin,cy+22*hourCos,{rotate:hourAngle}); g.drawImage(imgHour,cx-22*hourSin,cy+22*hourCos,{rotate:hourAngle});
g.drawImage(imgMin,cx-34*minSin,cy+34*minCos,{rotate:minAngle}); g.drawImage(imgMin,cx-34*minSin,cy+34*minCos,{rotate:minAngle});
g.drawImage(imgSec,cx-25*secSin,cy+25*secCos,{rotate:secAngle}); g.drawImage(imgSec,cx-25*secSin,cy+25*secCos,{rotate:secAngle});
g.setFont("4x5Numeric:3"); g.setFontRolexFont();
g.setColor(g.theme.bg); g.setColor(g.theme.bg);
g.drawString(d.getDate(),157,81); g.setFontAlign(0,0,0);
g.drawString(d.getDate(),165,89);
} }
function drawBackground() { function drawBackground() {

View File

@ -0,0 +1,3 @@
[ZoneTransfer]
ZoneId=3
HostUrl=about:internet

BIN
apps/rolex/screenshot1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -0,0 +1,3 @@
[ZoneTransfer]
ZoneId=3
HostUrl=about:internet