AFAIK, ListBoxes can't have multi-line items, so you can't get the wrap-around effect you want you want. I tink you'll need to split the longer lines of text into shorter ones that fit the ListBox. You could write a custom function for adding items to the ListBox, that automaticaly splits too-wide lines into multiple entries.
Code: ags
(Use in place of ListBox.AddItem. Quickly tested - works OK, but might not be what you want.)
That, or work out line lengths and split them yourself...
The problems I can see here are that you won't be able to check/manipulate items as easily - you won't know if a given item needs to be combined with the lines before or after it to get the full text, how much of the text is in each 'line' (without testing the game and checking), and obviously deleting items becomes harder as well (if you remove item[X], do yu have to remove item [X+/-1] as well?). I'm not sure how you'd simply resolve these, sorry.
function AddItemWrapped(this ListBox*, String text) {
if (GetTextWidth(text, this.Font) < this.Width) this.AddItem(text);
else {
String TempItem = text;
while (GetTextWidth(TempItem, this.Font) > this.Width || TempItem.Chars[TempItem.Length-1] != ' ') {
TempItem = TempItem.Truncate(TempItem.Length-1);
}
this.AddItem(TempItem);
text = text.Substring(TempItem.Length, text.Length-TempItem.Length);
this.AddItemWrapped(text);
}
}
(Use in place of ListBox.AddItem. Quickly tested - works OK, but might not be what you want.)
That, or work out line lengths and split them yourself...
The problems I can see here are that you won't be able to check/manipulate items as easily - you won't know if a given item needs to be combined with the lines before or after it to get the full text, how much of the text is in each 'line' (without testing the game and checking), and obviously deleting items becomes harder as well (if you remove item[X], do yu have to remove item [X+/-1] as well?). I'm not sure how you'd simply resolve these, sorry.