Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Mugs on Sat 18/02/2006 18:21:49

Title: "RPG-style" speech
Post by: Mugs on Sat 18/02/2006 18:21:49
I have two questions:

First of all, I want the speech text to appear in a small box at the bottom of the screen.  Kinda like a text window, but I don't want the window to change it's size depending on the amount of text written.  How can I do that?

Second, is it possible to make the text gradually appear, one letter at the time?

All I want is a kind of "RPG-style" speech.


Title: Re: "RPG-style" speech
Post by: Ashen on Sat 18/02/2006 18:53:02
For the first question - You could script a custom function to turn on a GUI with a Label object to display the text where and with whatever width you want, e.g. (V2.7 code)

function DisplayEx(string message) {
  lblDisplay.SetText(message);
  gDisplay.Visible = true;
  WaitMouseKey(40);
  gDisplay.Visible = false);
}

There IS a way to specify a maximum width for Display messages (e.g. see the DisplayAt(...) (http://www.adventuregamestudio.co.uk/manual/DisplayAt.htm) function), but I don't think there's a way to set a minimum - unless you want to make a function to pad messages out with spaces, until they reach the required width.

For the second one, Kinoko wanted something similar a while ago, this was the outcome (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=14733.0) - and a forum search for 'TypeLine', or 'Typewriter text' should turn up a few other options and improvements to the code.