SLUDGE

say and think


Syntax:

say (thisObject, textToSay);

say (thisObject, textToSay, soundFile);

think (thisObject, textToThink);

think (thisObject, textToThink, soundFile);

Purpose:

Makes thisObject say the contents of the textToSay parameter (or think the contents of the textToThink parameter). The text is shown on the screen in the speech colour defined in the object type definition. If a soundFile parameter is specified, the sound may be used instead of (or as well as) the text - this depends on the current setSpeechMode setting.

If thisObject is a character:

Any displayed text will be shown over the head of the character. If the say command is being used, the character's current animation will be changed to the speaking animation (for the character facing its current direction) defined in the costume assigned to the character. When the character has finished speaking, the character's animation will change to the standing still animation. If the think command is being used, the character will not be made to animate.

If thisObject is a screen region:

Any displayed text will be shown above the last region to have been added which represents the object; that is, if there are three screen regions which represent the same object and the object is told to speak, the text will appear over the third region.

If thisObject isn't a character or screen region:

Any displayed text will appear centred at the top of the screen.

The function from which the say command is called will pause until the object stops speaking. The time this takes depends on the number of characters in textToSay or textToThink and is calculated by the SLUDGE engine at runtime. If the soundFile parameter is specified (and used), the time for which the function pauses is the length of time needed to play the sound.

Valid file formats for the soundFile parameter are Windows wave files (.WAV) and Ogg Vorbis (.OGG), as in the playSound and loopSound functions.

Return value:

No return value.

See also:

addCharacter

addScreenRegion

cacheSound

setSpeechSpeed

skipSpeech

somethingSpeaking