lua api: display.clear could be added back
There does not seem to be a way to clear the display without first putting some text into the buffer, and then displaying it. So, it is possible to clear the display, but you have to issue a seemingly unnecessary text call to do it. Here is an example:
frame.display.text('Hello world',50,100)
frame.display.show()
frame.display.text('',50,100) -- empty does not work
frame.display.show() -- does nothing
frame.display.text(' ',50,100) --non-empty works
frame.display.show() -- clears screen
Primary suggestion: re-add a clear function to the lua api Secondary suggestion: make display.show with any empty buffer clear the display
Thanks!
Which firmware are you using? frame.display.show() should clear if no other draw command was given prior
It was the latest at the time.
This part
frame.display.text('',50,100) -- empty does not work frame.display.show() -- does nothing
Is what I would think is a bug/oddity, because it should clear. I did not try to display.show() in a row.
I get the same behaviour on firmware v24.200.1206 - that is, the display isn't cleared if I only call frame.display.show() without any other draw calls.
Thanks!
Update: Firmware v24.276.1359
Back-buffer clearing still seems to have a bug, and now the approach of "drawing a ' ' of text, then calling show()" doesn't work either.
When trying to clear the back buffer using a single space and show(), I got this (just the space character overlaid on the previous buffer). Calling show() twice in a row (with nothing in between) also doesn't clear the display, as before.
Other times the glitch shows up is just sending a break signal on wakeup - the "tap me in" prompt sometimes isn't cleared when the "Frame is Paired" text is shown. But other times it is - it's just intermittent.
So now it's not clear what would clear the display at all. @siliconwitch said he'll try to take a look at this before long - thanks.