Multi Line Text

BlitzPlus Forums/BlitzPlus Programming/Multi Line Text

Make a format function, which formats a string (strings can be any length) to any given width and
- auto wraps words
- puts a whole word on a new line when it doesn't fit the line anymore

You could do something like that with a bank, the banksize is the givin width of a line * the amount of lines it will eventually take. Naturally you start with 1 line, and when a new line needs to be created you resize the bank again.

When you're done, use this bank to read the chars from and build-up the screen.

example:

bank=FormatText$(txt$,width)

and:

Drawtext(bank)