ctrlpad: overlay rendering

pull/3383/head
Rob Pilling 2023-08-04 22:48:40 +01:00
parent 1f9acd2704
commit 6c19423c24
1 changed files with 5 additions and 3 deletions

View File

@ -8,7 +8,6 @@
constructor() {
// x padding: 10 each side
// y top: 24, y bottom: 10
this.width = g.getWidth() - 10 * 2;
this.height = g.getHeight() - 24 - 10;
@ -41,6 +40,10 @@
const centreY = this.height / 2;
const circleGapY = 30;
g
.setFontAlign(0, 0)
.setFont("Vector:20");
this.drawCtrl(this.width / 4 - 10, centreY - circleGapY, "<");
this.drawCtrl(this.width / 2, centreY - circleGapY, "@");
this.drawCtrl(this.width * 3/4 + 10, centreY - circleGapY, ">");
@ -56,11 +59,10 @@
.setColor("#fff")
.fillCircle(x, y, 23)
.setColor("#000")
.setFontAlign(0, 0)
.setFont("Vector:20")
.drawString(label, x, y);
}
}
const settings = require("Storage").readJSON("setting.json", true) as Settings || ({ HID: false } as Settings);
if (settings.HID !== "kbmedia") {
console.log("widhid: can't enable, HID setting isn't \"kbmedia\"");