toeoe
November 23, 2021, 8:38pm
1
Hello,
another question about scrolling text.
By default, the text scrolls from one edge of the display to the other.
scrollingLayer.setColor(colorGreen);
scrollingLayer.setMode(wrapForward);
scrollingLayer.setSpeed(80);
scrollingLayer.setOffsetFromTop(117);
scrollingLayer.setStartOffsetFromLeft(50);
scrollingLayer.setFont(font8x13);
scrollingLayer.start(“Scrolling text”, 1);
while (scrollingLayer.getStatus());
I’ve tried the various scroll modes and the “setStartOffsetFromLeft”, but I can’t get the text to start, for example, from the left edge with a distance of 20 pixels and stop from the right edge 20 pixels before that.
Is this even possible or does the text always have to scroll across the entire display?
Best regards
Thomas
Louis
November 24, 2021, 12:05am
2
Sorry, that’s not a mode that’s in SmartMatrix Library. You could custom code it, here’s someone that added their own mode to SmartMatrix Library:
pixelmatix:master
← maxregan:scroll-peek
opened 03:02PM - 12 Oct 21 UTC
The "peek" modes scroll the text without allowing the start and end of the text … within the display's bounds. That is, the display never shows empty space if the text is longer than the display.
My current project uses an ESP without the Adafruit GFX libraries, so I have implemented for both Layers that implement scrolling capability, however I have tested both implementations.
Resolves #158
1 Like
toeoe
November 24, 2021, 12:39pm
3
Thank you very much Louis, that is excellent.
Louis
November 24, 2021, 2:19pm
4
I just thought of this: you could possibly add spaces to the start and end of your text in combination with one of the existing modes to get close to the effect you want
toeoe
November 24, 2021, 3:15pm
5
Unfortunately not, as the text will then only scroll slightly later over the area where it should not scroll.
I will try the “peek”-mode you linked. That sounds good