gfx.scroll and linewrap font

Posted on
  • I like the way that the notify app/module is able to scroll the screen. What are the limits of scrolling? Is scrolling possible because the 'graphic buffer' has more 'data space' than the display surface/screen requires for its size? I am a bangle user so answer can apply more to that, but the question is generic. What is the benefits of double buffered mode? Does using scrolling use more ram than not using scrolling?

    Secondly, is there any library written to handle line-wrapping text, so that it doesn't go off-screen?

    When is 'terminal' mode useful?

  • Hi!

    Generally on Espruino scrolling only works on offscreen buffers, but on Bangle.js it's a bit of a special case because as you note there's a bigger screen buffer than is displayed, and the display controller allows us to move the display window around within it - it makes scrolling super fast.

    The screen is 240x240 but the buffer is 240x320. As such you can only scroll vertically, and the notifications perform a bit of magic to allow them to be drawn on the extra 80 rows of the buffer while everything else still goes to the 'normal' 240 rows.

    What is the benefits of double buffered mode?

    Draw operations are faster, there's no flicker, and you can read back data with getPixel. Also you can scroll horizontally.

    Does using scrolling use more ram than not using scrolling?

    No - the RAM was always there in the display, just not getting used. Since we can't read back from it, it can't be used for anything other than the display.

    is there any library written to handle line-wrapping text, so that it doesn't go off-screen?

    Afraid not - there is the code built into the notify library though. It would actually make a pretty useful module.

    When is 'terminal' mode useful?

    You mean Terminal.println and Terminal.setConsole? It's just an easy way to write text. Generally you wouldn't use it for an app, but if you want to write an error to the screen quickly it's a good way of doing it (and Espruino does that automatically if 'Debug Info' is set to 'show').

    Theoretically if you added a Bluetooth LE keyboard you could use the Terminal to actually write JS code as you might on the left-hand side of the IDE.

  • Theoretically if you added a Bluetooth LE keyboard you could use the Terminal to actually write JS code as you might on the left-hand side of the IDE.

    How practically difficult would it be to connect a BLE keyboard to the bangle?

    Also, is there a way to draw on every 'frame' , how often am i supposed to be sending graphic updates? EDIT: found the flip function! and a flappy bird example ;)

    Why is the default unbuffered/direct if there are such benefits to double buffered?
    Ah obviously its screen space which is the tradeoff.
    What is the refresh rate of the LCD?

  • How practically difficult would it be to connect a BLE keyboard to the bangle?

    I don't think it's too hard, and I would have done it but the issue is finding an actual Bluetooth Low Energy keyboard.

    Why is the default unbuffered/direct if there are such benefits to double buffered?

    Double buffered is less screen size, and the buffered examples (80x80,etc) use a bunch of RAM.

    What is the refresh rate of the LCD?

    120Hz? I'm not sure, you'd have to look at the datasheet. Realistically you will never hit it though because the bandwidth to the display itself is too low.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

gfx.scroll and linewrap font

Posted by Avatar for d3nd3-o0 @d3nd3-o0

Actions