1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-13 05:06:30 +04:00

js modules updates

by Willy-JL
This commit is contained in:
MX
2024-03-23 23:18:26 +03:00
parent 46a90ec97f
commit c323656037
6 changed files with 243 additions and 9 deletions

View File

@@ -0,0 +1,24 @@
let textbox = require("textbox");
// Set config before setting text
// Focus (start / end), Font (text / hex)
textbox.setConfig("end", "text");
let text = "Example dynamic updating textbox\n";
textbox.setText(text);
// Non-blocking, can keep updating text after, can close in JS or in GUI
textbox.show();
let i = 0;
while (textbox.isOpen() && i < 20) {
print("console", i++);
text += "textbox " + to_string(i) + "\n";
textbox.setText(text);
delay(500);
}
// If not closed by user (instead i < 20 is false above), close forcefully
if (textbox.isOpen()) {
textbox.close();
}