Wordwrap issue creating a chat UI with DirectScrolledList


I’m creating a chat UI for a game that I’m working on. Everything is working except for the fact that I can’t have multiline items on the list.

I have an itemMakeFunction that creates a DirectFrame item for every line of chat.

I’ve tried 3 things so far:

  1. Just add the text to the DirectScrolledList: this doesn’t work, since DSL has problems calculating the height of the items.
  2. Set forceHeight on DSL and wordWrap on the DirectFrame item: this works perfectly for items of one line, but if the item has 2 or more lines, the next item will be written over the 2nd line of that item.
  3. Don’t set forceHeight nor wordWrap, but calculate the height of each item based on the max chars that I want to be shown per line and set it on DirectFrame’s frameSize option: I thought this was the right choice, but it seems that the DSL problems calculating items sizes applies here too, since it’s changing sizes every time I add an item to the list. :frowning:

My last idea is to slice each chat line into several items (depending on its lenght) but it seems like an ugly solution for something that should be easily (and cleanly (?)) done.

Ideas? :unamused: