getbounds for character string

Feb 5, 2014 at 8:29pm

getbounds for character string

Hi everyone,

I need to make a horizontal scrolling text patch, and I want to get the length of a text file (string of characters) so that I can appropriately set its initial position in the jit.gl.text2d object.

I literally saw this done a few days ago, but didn’t have the chance to copy the patch and now I can’t recreate it. Any takers?

Thanks!

#280209
Feb 6, 2014 at 10:54am

you may have more success using gl.text3d, and the querying the @bounds attribute with the getbounds message.

#280268
Feb 6, 2014 at 10:57am

you also have to set @boundcalc 1 for this to work.
<code>

– Pasted Max Patch, click to expand. –

</code>

#280269
Feb 11, 2014 at 6:08am

thanks rob for this hidden message !
o documentation would be nice ;-)

it would be great to do soft wraping text with jit.gl.text2d or jit.gl.text3d.

i tyed it with the also undocumented bound message.

the only way i found, is to do this in jit.mgraphics by checking every single characters position and do the linebreaks “by hand”.

thanks,
pc

#280718

You must be logged in to reply to this topic.