mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
JS: Small improvements to widget example
This commit is contained in:
@@ -21,8 +21,8 @@ widget.addCircle(12, 52, 10);
|
||||
widget.addDisc(12, 52, 5);
|
||||
|
||||
// add a frame/box (x, y, width, height)
|
||||
widget.addFrame(25, 45, 10, 10);
|
||||
widget.addBox(27, 47, 6, 6);
|
||||
widget.addFrame(30, 45, 10, 10);
|
||||
widget.addBox(32, 47, 6, 6);
|
||||
|
||||
// add a rounded frame/box (x, y, width, height, radius)
|
||||
widget.addRframe(50, 45, 15, 15, 3);
|
||||
@@ -38,7 +38,7 @@ widget.addIcon(100, 50, "ButtonUp_7x4");
|
||||
widget.addIcon(100, 55, "ButtonDown_7x4");
|
||||
|
||||
// add a glyph (x, y, glyph)
|
||||
widget.addGlyph(120, 50, 0x23);
|
||||
widget.addGlyph(115, 50, "#".charCodeAt(0));
|
||||
|
||||
// Show the widget (drawing the layers in the orderer they were added)
|
||||
widget.show();
|
||||
@@ -52,7 +52,7 @@ while (widget.isOpen() && i <= demo_seconds) {
|
||||
// You can call remove on any added item, it does not impact the other ids.
|
||||
if (bitmap) { widget.remove(bitmap); bitmap = undefined; }
|
||||
// All of the addXXX functions return an id that can be used to remove the item.
|
||||
else { bitmap = widget.addXbm(80, 45, logo); }
|
||||
else { bitmap = widget.addXbm(77, 45, logo); }
|
||||
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user