feat: updated config

pull/1/head
flop 4 weeks ago
parent 942d7dff70
commit 1cc948a85c
  1. 22
      ts/index.html

@ -135,13 +135,14 @@
label: "Blink (animation)", label: "Blink (animation)",
make() { make() {
return new MonoDisplayFile({ return new MonoDisplayFile({
width: W, height: H,
elements_always: [{ elements_always: [{
type: ElementType.Animation, type: ElementType.Animation,
width: W, height: H, width: W, height: H,
// updateInterval: 0 = advance every tick (25fps → ~400ms/frame at fps=25 with 2 frames)
updateInterval: 12, // every 13 ticks ≈ 500ms per frame at 25fps
frames: [ frames: [
{ pixels: new Uint8Array(W * H).fill(1), durationMs: 200 }, { pixels: new Uint8Array(W * H).fill(1) },
{ pixels: new Uint8Array(W * H).fill(0), durationMs: 200 }, { pixels: new Uint8Array(W * H).fill(0) },
], ],
}], }],
}).toBuffer(); }).toBuffer();
@ -151,7 +152,12 @@
label: "Text (centered)", label: "Text (centered)",
make() { make() {
return new MonoDisplayFile({ return new MonoDisplayFile({
elements_always: [{ type: ElementType.Text, text: "Hello, World!", align: 1 }], elements_always: [{
type: ElementType.ClippedText,
text: "Hello, World!",
xOffset: 0, yOffset: 32,
width: W, height: 16,
}],
}).toBuffer(); }).toBuffer();
}, },
}, },
@ -160,10 +166,12 @@
make() { make() {
return new MonoDisplayFile({ return new MonoDisplayFile({
elements_always: [{ elements_always: [{
type: ElementType.ScrollText, type: ElementType.HScrollText,
text: "MONO DISPLAY — scrolling ticker — 🚀 ", text: "MONO DISPLAY — scrolling ticker — 🚀 ",
speedPps: 80, xOffset: 0, yOffset: 32,
direction: 0, width: W, height: 16,
scrollSpeed: 50, // (50+1)/16 ≈ 3.2 px/tick at 25fps ≈ 80px/s
flags: { endless: true, invertDirection: false },
}], }],
}).toBuffer(); }).toBuffer();
}, },

Loading…
Cancel
Save