Scrolling Text in a text box

edited October 2013 in How To...

I want to create a text box that will auto scroll horizontally when the mouse hovers over the box to handle a problem with text overflowing on to other elements in my sketch. I understand how to get text to scroll across the screen but I would like to "lock" this text to a defined area and have the text fade as it scrolls inside this box and reset when the mouse moves away. Are there any resources for behaviors like this or any suggestions as to how to attack this problem?

Answers

  • Answer ✓

    No code in sight, so moved to the How To category (hint: these two words are in your message...).

    You probably need to draw the text on a separate PGraphics of the size of your text box. So text beyond the surface of the PGraphics isn't drawn, and when you draw it on the sketch area, you see the text cropped to the right dimensions.

  • PhiLho.....thanks for the recommendations I've never used PGraphics but I'm going to look into it. This sounds like exactly what I was looking for!

Sign In or Register to comment.