Multi Line Strings

Rory's Avatar

Rory

05 Apr, 2015 11:45 AM

Sometimes I need to label my visuals with strings from cvs files. This can be frustrating when the strings are long, and need to be broken over multiple lines.

Previously I would just write out the string to include line breaks, but that was inefficient really. So I have written a recursive function that takes a user string and an integer length and returns a string with line breaks.

It seems to work nicely. If anyone has any comments/better ideas for implementing this please comment.

Thanks :-)

Rory

  1. Support Staff 1 Posted by john on 06 Apr, 2015 04:55 AM

    john's Avatar

    Rory,

    How is this different from simply setting the width parameter in the text path node? (See attached screenshot.)

    I'm probably missing something. If so, could you attach your nodebox file so I could play with it myself?

  2. 2 Posted by Rory on 06 Apr, 2015 04:58 AM

    Rory's Avatar

    Wow, I'm so dim sometimes. My first thought is always just to try and reinvent the wheel, when the NodeBox team have done a pretty good job of inventing it for us....

    feeling bashful

  3. Support Staff 3 Posted by john on 06 Apr, 2015 05:04 AM

    john's Avatar

    No prob. The same thing happens to me all the time. There is a lot of subtlety to NodeBox and little documentation to help us grasp it. These forum discussions are the best way we have to bring all those hidden features to light.

  4. 4 Posted by c4632797 on 23 Jun, 2016 01:38 AM

    c4632797's Avatar

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • mult_lines.png 24.1 KB
  • Screen_Shot_2015-04-05_at_17.44.26.png 88.4 KB
  • user_funcs.py 868 Bytes

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

16 Jun, 2022 05:30 AM
15 Jun, 2022 06:03 AM
06 Jun, 2022 01:07 PM
02 Jun, 2022 11:58 PM
30 May, 2022 07:48 AM

 

24 May, 2022 06:27 PM
20 May, 2022 04:12 PM
05 May, 2022 02:25 AM
03 May, 2022 04:46 AM
01 May, 2022 09:22 AM
18 Apr, 2022 09:01 PM