Due to server issues & outages with Endicia - There is no USPS / Postal service orders at this time - Read more.

[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 3: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 10:58 pm

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

by adafruit_support_rick on Sat Feb 23, 2013 10: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: ).
User avatar
Posts: 12009
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY