Interface for dialogue UI components. More...
Public Member Functions | |
void | Open () |
Called when a conversation starts, use Open() to do any setup – for example, to show the conversation GUI controls. | |
void | Close () |
Called when a conversation ends, use Close() to clean up – for example, to hide the conversation GUI controls. | |
void | ShowSubtitle (Subtitle subtitle) |
Shows a subtitle. | |
void | HideSubtitle (Subtitle subtitle) |
Hides a subtitle. | |
void | ShowResponses (Subtitle subtitle, Response[] responses, float timeout) |
Shows the player response menu. | |
void | HideResponses () |
Hides the player response menu. | |
void | ShowQTEIndicator (int index) |
Shows a QTE (Quick Time Event) indicator. | |
void | HideQTEIndicator (int index) |
Hides a QTE (Quick Time Event) indicator. | |
void | ShowAlert (string message, float duration) |
Shows an alert message. | |
void | HideAlert () |
Hides the alert message if it's showing. | |
Events | |
EventHandler< SelectedResponseEventArgs > | SelectedResponseHandler |
Your implementation must define this event and make it public. | |
Interface for dialogue UI components.
A dialogue UI is responsible for displaying subtitles, presenting the player response menu, and showing alerts.
See UnityDialogueUI for a reference implementation that uses Unity GUI.
void PixelCrushers.DialogueSystem.IDialogueUI.Close | ( | ) |
Called when a conversation ends, use Close() to clean up – for example, to hide the conversation GUI controls.
Implemented in PixelCrushers.DialogueSystem.BarkDialogueUI, PixelCrushers.DialogueSystem.AbstractDialogueUI, PixelCrushers.DialogueSystem.SMSDialogueUI, and PixelCrushers.DialogueSystem.StandardDialogueUI.
void PixelCrushers.DialogueSystem.IDialogueUI.HideAlert | ( | ) |
Hides the alert message if it's showing.
Implemented in PixelCrushers.DialogueSystem.BarkDialogueUI, and PixelCrushers.DialogueSystem.AbstractDialogueUI.
void PixelCrushers.DialogueSystem.IDialogueUI.HideQTEIndicator | ( | int | index | ) |
Hides a QTE (Quick Time Event) indicator.
index | Index number of the QTE indicator. |
If your project doesn't use QTEs, you can just create an empty method.
Implemented in PixelCrushers.DialogueSystem.BarkDialogueUI, and PixelCrushers.DialogueSystem.AbstractDialogueUI.
void PixelCrushers.DialogueSystem.IDialogueUI.HideResponses | ( | ) |
Hides the player response menu.
Implemented in PixelCrushers.DialogueSystem.TextMeshProSupport.TextMeshProDialogueUI, PixelCrushers.DialogueSystem.BarkDialogueUI, PixelCrushers.DialogueSystem.AbstractDialogueUI, and PixelCrushers.DialogueSystem.UnityUIDialogueUI.
void PixelCrushers.DialogueSystem.IDialogueUI.HideSubtitle | ( | Subtitle | subtitle | ) |
Hides a subtitle.
subtitle | The subtitle to hide. |
Implemented in PixelCrushers.DialogueSystem.TextMeshProSupport.TextMeshProDialogueUI, PixelCrushers.DialogueSystem.BarkDialogueUI, PixelCrushers.DialogueSystem.AbstractDialogueUI, PixelCrushers.DialogueSystem.SMSDialogueUI, PixelCrushers.DialogueSystem.StandardDialogueUI, and PixelCrushers.DialogueSystem.UnityUIDialogueUI.
void PixelCrushers.DialogueSystem.IDialogueUI.Open | ( | ) |
Called when a conversation starts, use Open() to do any setup – for example, to show the conversation GUI controls.
Implemented in PixelCrushers.DialogueSystem.NGUISupport.NGUIDialogueUI, PixelCrushers.DialogueSystem.TextMeshProSupport.TextMeshProDialogueUI, PixelCrushers.DialogueSystem.BarkDialogueUI, PixelCrushers.DialogueSystem.AbstractDialogueUI, PixelCrushers.DialogueSystem.UnityGUI.UnityDialogueUI, PixelCrushers.DialogueSystem.SMSDialogueUI, PixelCrushers.DialogueSystem.StandardDialogueUI, and PixelCrushers.DialogueSystem.UnityUIDialogueUI.
void PixelCrushers.DialogueSystem.IDialogueUI.ShowAlert | ( | string | message, |
float | duration | ||
) |
Shows an alert message.
The dialogue system will not call Open() before ShowAlert(), nor Close() afterward, since alert messages are intended to be shown outside of conversations.
message | The message to show. |
duration | The duration in seconds to show the message. |
Implemented in PixelCrushers.DialogueSystem.NGUISupport.NGUIDialogueUI, PixelCrushers.DialogueSystem.TextMeshProSupport.TextMeshProDialogueUI, PixelCrushers.DialogueSystem.BarkDialogueUI, PixelCrushers.DialogueSystem.AbstractDialogueUI, PixelCrushers.DialogueSystem.StandardDialogueUI, and PixelCrushers.DialogueSystem.UnityUIDialogueUI.
void PixelCrushers.DialogueSystem.IDialogueUI.ShowQTEIndicator | ( | int | index | ) |
Shows a QTE (Quick Time Event) indicator.
index | Index number of the QTE indicator. |
If your project doesn't use QTEs, you can just create an empty method.
Implemented in PixelCrushers.DialogueSystem.BarkDialogueUI, and PixelCrushers.DialogueSystem.AbstractDialogueUI.
void PixelCrushers.DialogueSystem.IDialogueUI.ShowResponses | ( | Subtitle | subtitle, |
Response[] | responses, | ||
float | timeout | ||
) |
Shows the player response menu.
When the player selects a response, your implementation must call the SelectedResponseHandler event and pass along a SelectedResponseEventArgs object containing the selected response.
Example: private void OnResponseClicked(Response response) { SelectedResponseHandler(this, new SelectedResponseEventArgs(response)); }
subtitle | The most recently displayed subtitle. Your implementation might show this subtitle to remind the player what he or she is responding to. |
responses | The responses. |
timeout | If not 0 , the duration in seconds that the player has to choose a response; otherwise the currently-focused response is auto-selected. If no response is focused (e.g., hovered over), the first response is auto-selected. If 0 , there is no timeout; the player can take as long as desired to choose a response. |
Implemented in PixelCrushers.DialogueSystem.TextMeshProSupport.TextMeshProDialogueUI, PixelCrushers.DialogueSystem.BarkDialogueUI, PixelCrushers.DialogueSystem.AbstractDialogueUI, PixelCrushers.DialogueSystem.SMSDialogueUI, PixelCrushers.DialogueSystem.StandardDialogueUI, and PixelCrushers.DialogueSystem.UnityUIDialogueUI.
void PixelCrushers.DialogueSystem.IDialogueUI.ShowSubtitle | ( | Subtitle | subtitle | ) |
Shows a subtitle.
subtitle | The subtitle to show. Subtitles contain information such as the player type (PC or NPC), portrait texture, and the formatted text of the line. |
Implemented in PixelCrushers.DialogueSystem.NGUISupport.NGUIDialogueBarkUI, PixelCrushers.DialogueSystem.NGUISupport.NGUIDialogueUI, PixelCrushers.DialogueSystem.TextMeshProSupport.TextMeshProDialogueUI, PixelCrushers.DialogueSystem.BarkDialogueUI, PixelCrushers.DialogueSystem.AbstractDialogueUI, PixelCrushers.DialogueSystem.SMSDialogueUI, PixelCrushers.DialogueSystem.StandardDialogueUI, PixelCrushers.DialogueSystem.UnityUIBarkSubtitleDialogueUI, and PixelCrushers.DialogueSystem.UnityUIDialogueUI.
EventHandler<SelectedResponseEventArgs> PixelCrushers.DialogueSystem.IDialogueUI.SelectedResponseHandler |
Your implementation must define this event and make it public.
Example:
public event EventHandler<SelectedResponseEventArgs> SelectedResponseHandler;