exactly how is text speed calculated? (SOLVED)

Started by EnterTheStory (aka tolworthy), Thu 22/05/2008 22:43:16

Previous topic - Next topic

EnterTheStory (aka tolworthy)

Does anyone know the exact formula for how long 'Say' will keep text on the screen? I have some characters that need to disappear at the exact same time as text disappears.

Thanks in advance.

GarageGothic

From the AGS Tidbits & Snippest doc:

The number of gameloops a speech string is displayed:

Code: ags
int gameloops = ((StrLen(text) / game.text_speed) + 1) * GetGameSpeed();


StrLen() is obsolete though, so formatted to new style code, it would be (assuming a String named "text"):

Code: ags
int gameloops = ((text.Length / game.text_speed) + 1) * GetGameSpeed();

Radiant

Note that the above implies that you can cause a text to be displayed longer, by padding it with spaces.

EnterTheStory (aka tolworthy)

Thanks. That was exactly what I was looking for.

SMF spam blocked by CleanTalk