Memorial day is 05/25/2015 – Orders will ship out on May 26th. There will not be any deliveries or shipping on Monday. Any order placed after 11am ET on Friday May 22nd will not start to ship out until Tuesday May 26th.

[TFT 2.8] Disable wrap would rather Scroll?
Moderators: adafruit_support_bill, adafruit

[TFT 2.8] Disable wrap would rather Scroll?

by civicbynature on Sat Feb 23, 2013 4:13 am

I'm currently working on an awesome project I hope to show off very soon .
Using the raspberry pi, arduino and adafruit's 2.8 TFT breakout.

I'm sending strings of text from the Rpi to arduino via uart to be displayed on the Lcd. But what I really need or I guess need to know is How or is it possible to disable the wrap feature for text and instead some how get the text to scroll left or right?
I know I can just make the text smaller to fit more on a line but that is so aesthetically unpleasing. :roll:

The goal is to display titles of songs and/or radio streams within a certain area and not wrap to the next line, as it would then interfere with other Areas, buttons etc...


User avatar
Posts: 37
Joined: Wed Feb 09, 2011 11:58 pm

Re: [TFT 2.8] Disable wrap would rather Scroll?

by adafruit_support_rick on Sat Feb 23, 2013 11:21 am

To disable text wrapping, use setTextWrap(false).

To make the line scroll, you write it over and over again, each time advancing the "start" of the line. Here's a VERY simplistic illustration:

Code: Select all | TOGGLE FULL SIZE
tft.print("Scrolling…  ");
tft.print("crolling…  S");
tft.print("rolling…  Sc");

You would actually want to do it by moving pointers around in a single character buffer (left as an exercise for the reader :wink: ).

Posts: 18369
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY