PixelCrushers.DialogueSystem.TK2D.TK2DDialogueUI Class Reference

This component implements IDialogueUI using 2D Toolkit. More...

Inheritance diagram for PixelCrushers.DialogueSystem.TK2D.TK2DDialogueUI:
Collaboration diagram for PixelCrushers.DialogueSystem.TK2D.TK2DDialogueUI:

Public Member Functions

override void Awake ()
 Sets up the component. More...
 
override void Start ()
 Starts this instance by hiding everything. More...
 
- Public Member Functions inherited from PixelCrushers.DialogueSystem.AbstractDialogueUI
virtual void Open ()
 Opens the conversation GUI. More...
 
virtual void Close ()
 Closes the conversation GUI. More...
 
virtual void ShowAlert (string message, float duration)
 Shows an alert. More...
 
virtual void HideAlert ()
 Hides the alert if it's showing. More...
 
virtual void Update ()
 Updates this instance by hiding the alert message when it's done. More...
 
virtual void ShowSubtitle (Subtitle subtitle)
 Shows the subtitle (NPC or PC) based on the character type. More...
 
virtual void HideSubtitle (Subtitle subtitle)
 Hides the subtitle based on its character type (PC or NPC). More...
 
virtual void ShowContinueButton (Subtitle subtitle)
 Shows the continue button. More...
 
virtual void HideContinueButton (Subtitle subtitle)
 Hides the continue button. More...
 
virtual void ShowResponses (Subtitle subtitle, Response[] responses, float timeout)
 Shows the player responses menu. More...
 
virtual void HideResponses ()
 Hides the player response menu. More...
 
virtual void ShowQTEIndicator (int index)
 Shows a QTE indicator. More...
 
virtual void HideQTEIndicator (int index)
 Hides a QTE indicator. More...
 
virtual void OnClick (object data)
 Handles response button clicks. More...
 
virtual void OnContinue ()
 Handles the continue button being clicked. More...
 
virtual void OnContinueAlert ()
 
virtual void OnContinueConversation ()
 
virtual void SetPCPortrait (Texture2D portraitTexture, string portraitName)
 Sets the PC portrait name and texture. More...
 
virtual void SetActorPortraitTexture (string actorName, Texture2D portraitTexture)
 Sets the portrait texture for an actor. More...
 

Public Attributes

tk2dUILayout UIRootLayout
 The GUI root. More...
 
tk2dSpriteCollectionData portraitCollection
 The sprite collection for portrait image sprites. More...
 
TK2DDialogueControls dialogue
 The dialogue controls. More...
 
tk2dBaseSprite[] qteIndicators
 The QTE (Quick Time Event) indicators. More...
 
TK2DAlertControls alert
 The alert message controls. More...
 

Properties

override AbstractUIRoot UIRoot [get]
 
override AbstractDialogueUIControls Dialogue [get]
 
override AbstractUIQTEControls QTEs [get]
 
override AbstractUIAlertControls Alert [get]
 
- Properties inherited from PixelCrushers.DialogueSystem.AbstractDialogueUI
abstract AbstractUIRoot UIRoot [get]
 Gets the user interface root. More...
 
abstract AbstractDialogueUIControls Dialogue [get]
 Gets the dialogue controls. More...
 
abstract AbstractUIQTEControls QTEs [get]
 Gets the QTE (Quick Time Event) indicators. More...
 
abstract AbstractUIAlertControls Alert [get]
 Gets the alert message controls. More...
 
bool IsOpen [get, set]
 Gets or sets a value indicating whether the dialogue UI (conversation interface) is open. More...
 
virtual bool AreNonDialogueControlsVisible [get]
 Gets a value indicating whether non-conversation controls (e.g., alert message or QTEs) are visible. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from PixelCrushers.DialogueSystem.AbstractDialogueUI
static Texture2D GetValidPortraitTexture (string actorName, Texture2D portraitTexture)
 Gets a valid portrait texture. More...
 
- Protected Member Functions inherited from PixelCrushers.DialogueSystem.AbstractDialogueUI
virtual void SetSubtitle (Subtitle subtitle, bool value)
 Sets a subtitle's content and visibility. More...
 
- Events inherited from PixelCrushers.DialogueSystem.AbstractDialogueUI
EventHandler< SelectedResponseEventArgsSelectedResponseHandler
 Occurs when the player selects a response. More...
 
- Events inherited from PixelCrushers.DialogueSystem.IDialogueUI
EventHandler< SelectedResponseEventArgsSelectedResponseHandler
 Your implementation must define this event and make it public. More...
 

Detailed Description

This component implements IDialogueUI using 2D Toolkit.

It's based on AbstractDialogueUI and compiles the TK2D versions of the controls defined in TK2DSubtitleControls, TK2DResponseMenuControls, TK2DAlertControls, etc.

To use this component, build a 2D Toolkit UI layout (or use a pre-built one in the Prefabs folder) and assign the UI control properties. You can save a TK2DDialogueUI as a prefab and assign the prefab or an instance to the DialogueManager.

If you use portrait images, create a sprite collection and assign it to this component.

Member Function Documentation

◆ Awake()

override void PixelCrushers.DialogueSystem.TK2D.TK2DDialogueUI.Awake ( )
virtual

Sets up the component.

Reimplemented from PixelCrushers.DialogueSystem.AbstractDialogueUI.

◆ Start()

override void PixelCrushers.DialogueSystem.TK2D.TK2DDialogueUI.Start ( )
virtual

Starts this instance by hiding everything.

The only exception is if an alert message is already showing; it keeps this message visible.

Reimplemented from PixelCrushers.DialogueSystem.AbstractDialogueUI.

Member Data Documentation

◆ alert

TK2DAlertControls PixelCrushers.DialogueSystem.TK2D.TK2DDialogueUI.alert

The alert message controls.

◆ dialogue

TK2DDialogueControls PixelCrushers.DialogueSystem.TK2D.TK2DDialogueUI.dialogue

The dialogue controls.

◆ portraitCollection

tk2dSpriteCollectionData PixelCrushers.DialogueSystem.TK2D.TK2DDialogueUI.portraitCollection

The sprite collection for portrait image sprites.

◆ qteIndicators

tk2dBaseSprite [] PixelCrushers.DialogueSystem.TK2D.TK2DDialogueUI.qteIndicators

The QTE (Quick Time Event) indicators.

◆ UIRootLayout

tk2dUILayout PixelCrushers.DialogueSystem.TK2D.TK2DDialogueUI.UIRootLayout

The GUI root.

Property Documentation

◆ Alert

override AbstractUIAlertControls PixelCrushers.DialogueSystem.TK2D.TK2DDialogueUI.Alert
get

◆ Dialogue

override AbstractDialogueUIControls PixelCrushers.DialogueSystem.TK2D.TK2DDialogueUI.Dialogue
get

◆ QTEs

override AbstractUIQTEControls PixelCrushers.DialogueSystem.TK2D.TK2DDialogueUI.QTEs
get

◆ UIRoot

override AbstractUIRoot PixelCrushers.DialogueSystem.TK2D.TK2DDialogueUI.UIRoot
get

The documentation for this class was generated from the following file: