How to fit text in a window

Max Björverud's icon

Hi,

Im implementing twitter posts into a video using an external and the technique in Jitter Tutorial 29. My problem is that most twitter posts won't fit in the video because the text is only one line.

How do I divide the text into different lines so that all 140 characters in a Twitter post will fit?

/Max

4074.tweet.png
png
Christopher Dobrian's icon

I just searched the forum for text wrapping.

Christopher Dobrian's icon
Max Patch
Copy patch and select New From Clipboard in Max.

And here's a method without JavaScript.

Peter Castine's icon

Nice patch, Chris. In a moment of nastiness, I fed it "antidisestablishmentarianism", which leads to strange behavior. I don't know if anyone wants to try to find a fix for this.

And, yes, I know that is *not* the longest word in the English language. But it's long enough.

Christopher Dobrian's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Good 'screw case', Peter! The bug is that, since the [i] box is initialized at 0, your string causes [zl slice 0], which sends the entire string out the right outlet, and voilà, an infinite loop. Here's a quick fix.