Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Atelier on Thu 29/04/2010 17:22:10

Title: More Than One Line [SOLVED]
Post by: Atelier on Thu 29/04/2010 17:22:10
I'm using a list box to display the responses for my game:

(http://img571.imageshack.us/img571/999/39185507.png)

As you can see it has no problem displaying smaller snippets of text (top), but when it comes to longer descriptions it carries on and on. Is there a simple way to get the text to carry onto a second or even third line? I preferably wanted all the text to still be in the same slot (without having to portion it up), but I'd be really grateful for any other suggestions.

Thanks,
AtelierGames
Title: Re: More Than One Line
Post by: Calin Leafshade on Thu 29/04/2010 17:32:46
can you use the new line escape character with list boxes?

i think the new line character for ags is the backslash.. try sticking that in.
Title: Re: More Than One Line
Post by: Atelier on Thu 29/04/2010 17:51:47
The new line operator is [, but unfortunately no, it doesn't work with a list box. :-\
Title: Re: More Than One Line
Post by: Calin Leafshade on Thu 29/04/2010 17:54:01
then you have alot of scripting ahead of you :p

essentially you need to use that font width function that tells you how long a stream of text is in pixels to split it up.
Title: Re: More Than One Line [SOLVED]
Post by: Atelier on Fri 30/04/2010 22:25:01
I bring great news! I just found this great code (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=32871.msg425131#msg425131) by monkey, and with tweaking, it does exactly the job I wanted!

(http://img35.imageshack.us/img35/3712/83367589.png)

Unfortunately it has the undesirable side-effect of not associating the response with the input. :- But not something that is impossible to fix. I said it wasn't. Thanks monkey for the code!