Adventure Creator  1.66.8
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2018
AC.Speech Class Reference

Public Member Functions

 Speech (Char _speaker, string _message, int lineID, string _language, bool _isBackground, bool _noAnimation, bool _preventSkipping=false)
 The default Constructor. More...
 
void UpdateVolume ()
 
 Speech (string _message)
 A special-case Constructor purely used to display text without tags when exporting script-sheets. More...
 
void UpdateDisplay ()
 
void EndPause ()
 
bool HasConditions (SpeechMenuLimit speechMenuLimit, SpeechMenuType speechMenuType, string limitToCharacters, SpeechProximityLimit speechProximityLimit=SpeechProximityLimit.NoLimit, float speechProximityDistance=0f)
 Checks if the speech line matches certain conditions. More...
 
void UpdateInput ()
 Updates the state of the Speech based on the user's input. This is called every Update call by StateHandler.
 
void EndBackgroundSpeechAudio (AC.Char newSpeaker)
 Ends speech audio, if it is playing in the background. More...
 
void EndSpeechAudio ()
 Ends speech audio, regardless of conditions.
 
string GetSpeaker (int languageNumber=0)
 Gets the display name of the speaking character. More...
 
Color GetColour ()
 Gets the colour of the subtitle text. More...
 
AC.Char GetSpeakingCharacter ()
 Gets the speaking character. More...
 
bool IsPaused ()
 Checks if the speech line is temporarily paused, due to a [wait] or [wait:X] token. More...
 
UnityEngine.Sprite GetPortraitSprite ()
 Gets a Sprite based on the portrait graphic of the speaking character. If lipsincing is enabled, the sprite will be based on the current phoneme. More...
 
Texture GetPortrait ()
 Gets the portrait graphic of the speaking character. More...
 
bool IsAnimating ()
 Checks if the speaking character's portrait graphic can be animated. More...
 
Rect GetAnimatedRect ()
 Gets a Rect of the character's portrait graphic. If the graphic is animating, only the relevant portion will be returned. More...
 
bool MenuCanShow (Menu menu)
 Checks if a Menu is able to show this speech line. More...
 

Public Attributes

SpeechLog log
 
bool isAlive
 
bool continueFromSpeech = false
 

Properties

string displayText [get]
 
bool isBackground [get]
 
bool hasAudio [get]
 
AC.Char speaker [get]
 
string FullText [get]
 
string SpeakerName [get]
 
int LineID [get]
 

Detailed Description

A container class for an active line of dialogue.

Constructor & Destructor Documentation

◆ Speech() [1/2]

AC.Speech.Speech ( Char  _speaker,
string  _message,
int  lineID,
string  _language,
bool  _isBackground,
bool  _noAnimation,
bool  _preventSkipping = false 
)

The default Constructor.

Parameters
_speakerThe speaking character. If null, the line is considered a narration
_messageThe subtitle text to display
lineIDThe unique ID number of the line, as generated by the Speech Manager
_languageThe currently-selected language
_isBackgroundTrue if the line should play in the background, and not interrupt Actions or gameplay
_noAnimationTrue if the speaking character should not play a talking animation
_preventSkippingTrue if the speech cannot be skipped regardless of subtitle settings in the Speech Manager

◆ Speech() [2/2]

AC.Speech.Speech ( string  _message)

A special-case Constructor purely used to display text without tags when exporting script-sheets.

Parameters
_messageThe subtitle text to display

Member Function Documentation

◆ EndBackgroundSpeechAudio()

void AC.Speech.EndBackgroundSpeechAudio ( AC.Char  newSpeaker)

Ends speech audio, if it is playing in the background.

Parameters
newSpeakerIf the line's speaker matches this, the audio will not end

◆ EndPause()

void AC.Speech.EndPause ( )

Ends the current pause.

◆ GetAnimatedRect()

Rect AC.Speech.GetAnimatedRect ( )

Gets a Rect of the character's portrait graphic. If the graphic is animating, only the relevant portion will be returned.

Returns
A Rect of the character's portrait graphic

◆ GetColour()

Color AC.Speech.GetColour ( )

Gets the colour of the subtitle text.

Returns
The colour of the subtitle text

◆ GetPortrait()

Texture AC.Speech.GetPortrait ( )

Gets the portrait graphic of the speaking character.

Returns
The speaking character's portrait graphic

◆ GetPortraitSprite()

UnityEngine.Sprite AC.Speech.GetPortraitSprite ( )

Gets a Sprite based on the portrait graphic of the speaking character. If lipsincing is enabled, the sprite will be based on the current phoneme.

Returns
The speaking character's portrait sprite

◆ GetSpeaker()

string AC.Speech.GetSpeaker ( int  languageNumber = 0)

Gets the display name of the speaking character.

Parameters
languageNumberThe index number of the language number to get the text in
Returns
The display name of the speaking character

◆ GetSpeakingCharacter()

AC.Char AC.Speech.GetSpeakingCharacter ( )

Gets the speaking character.

Returns
The speaking character

◆ HasConditions()

bool AC.Speech.HasConditions ( SpeechMenuLimit  speechMenuLimit,
SpeechMenuType  speechMenuType,
string  limitToCharacters,
SpeechProximityLimit  speechProximityLimit = SpeechProximityLimit.NoLimit,
float  speechProximityDistance = 0f 
)

Checks if the speech line matches certain conditions.

Parameters
speechMenuLimitWhat kind of speech has to play for this Menu to enable (All, BlockingOnly, BackgroundOnly)
speechMenuTypeWhat kind of speaker has to be speaking for this Menu to enable (All, CharactersOnly, NarrationOnly, SpecificCharactersOnly)
limitToCharactersA list of character names that this Menu will show for, if speechMenuType = SpeechMenuType.SpecificCharactersOnly
speechProximityLimitWhether or not the distance the Player/MainCamera is from the speaking character affects display
speechProximityDistanceThe maximum distance if speechProximityLimit != SpeechProximityLimit.NoLimit"
Returns
True if the speech line matches the conditions

◆ IsAnimating()

bool AC.Speech.IsAnimating ( )

Checks if the speaking character's portrait graphic can be animated.

Returns
True if the character's portrait graphic can be animated

◆ IsPaused()

bool AC.Speech.IsPaused ( )

Checks if the speech line is temporarily paused, due to a [wait] or [wait:X] token.

Returns
True if the speech line is temporarily paused.

◆ MenuCanShow()

bool AC.Speech.MenuCanShow ( Menu  menu)

Checks if a Menu is able to show this speech line.

Parameters
menuThe Menu to check against
Returns
True if the Menu is able to show this speech line

◆ UpdateDisplay()

void AC.Speech.UpdateDisplay ( )

Updates the state of the line. This is called every LateUpdate call by StateHandler.

◆ UpdateVolume()

void AC.Speech.UpdateVolume ( )

Updates the speech volume to the level set in Options. This should be called whenever the Speech volume level is changed.

Member Data Documentation

◆ continueFromSpeech

bool AC.Speech.continueFromSpeech = false

If True, then the Action that ran this speech will end, but the speech line is still active

◆ isAlive

bool AC.Speech.isAlive

True if the line is active

◆ log

SpeechLog AC.Speech.log

The line's SpeechLog entry

Property Documentation

◆ displayText

string AC.Speech.displayText
get

The display text

◆ FullText

string AC.Speech.FullText
get

The full display text of the line

◆ hasAudio

bool AC.Speech.hasAudio
get

If True, the speech line has an AudioClip supplied

◆ isBackground

bool AC.Speech.isBackground
get

True if the line should play in the backround, and not interrupt Actions or gameplay.

◆ LineID

int AC.Speech.LineID
get

The ID number of the line, as set by the Speech Manager

◆ speaker

AC.Char AC.Speech.speaker
get

The characters speaking the line, unless a narration

◆ SpeakerName

string AC.Speech.SpeakerName
get

The display name of the speaking character