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

06 Sep, 2023 07:20 AM
05 Sep, 2023 08:40 PM
30 Aug, 2023 03:16 AM
19 Aug, 2023 03:22 AM
29 Jul, 2023 05:52 AM

 

28 Jul, 2023 10:53 PM
23 Jul, 2023 07:04 AM
14 Jul, 2023 03:05 AM
07 Jul, 2023 06:26 AM
05 Jul, 2023 11:44 PM
30 Jun, 2023 12:48 PM