Programming question: Does setLCDOffset() work in Bangle 2? #4921
Replies: 1 comment
-
Posted at 2022-06-29 by @gfwilliams Unfortunately setLCDOffset was something that went through into the LCD hardware on Bangle.js 1 and made use of a chunk of extra offscreen memory - but that doesn't exist on Bangle.js 2. I have got a branch where I attempted to emulate the functionality, but so far I didn't have much success making that reliable. However you can just get an image of what's on the screen and repaint it after, so something like this actually just works fine:
The only issue is stopping other apps trying to draw things in the mean time (if you're not the main app running). The other thing I'd considered (which feels like less of a hack than scrolling) is to provide Bangle.js 2 with the ability to overlay a Graphics instance on top of the main screen buffer. It'd be slower to update the screen while doing that, but would be an awful lot more flexible (eg background still updating, non-square overlays, and so on). Posted at 2022-06-30 by CarlR Thanks for that. I was afraid it was probably the case! And I was worrying about it conflicting with other apps drawing to the screen. Are you stuck with where the screen buffer is? As I was wondering if you could have two and choose one or the other as the active one that's flipped to the screen. Both could be continued to be updated then. Your overlay approach does sound the best way to go though. Posted at 2022-06-30 by @gfwilliams
That's a good point - that would be relatively easy to implement, but we probably don't want to have two buffers kicking around all the time, so we might have to allocate the second one on demand. It wouldn't allow for the background updating while the foreground was displayed though - and I guess that would be a nice feature :) Posted at 2022-06-30 by CarlR Maybe an interim measure until you implement the overlay approach? :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-06-29 by CarlR
Bangle.setLCDOffset() promises to do what I'd like to do, (offset the current screen to display something else, then return to the previous screen), but I can't get it to work in Bangle 2. (Nothing changes when I give it an offset.) Is there a way to make it work that I've yet to discover, or a workaround if it doesn't?
Beta Was this translation helpful? Give feedback.
All reactions