PixelCrushers.DialogueSystem.TK2D.TK2DResponseButton Class Reference

A TK2D response button for TK2DDialogueUI. More...

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

Public Member Functions

void SetFormattedText (FormattedText formattedText)
 Sets the button's text using the specified formatted text. More...
 
void SetUnformattedText (string unformattedText)
 Sets the button's text using plain text. More...
 
void OnClick ()
 Handles a button click by calling the response handler. More...
 

Public Attributes

tk2dTextMesh label
 The text mesh that will display the response text. More...
 
Color defaultColor = Color.white
 The default color for response text, which can be overridden by emphasis tags. More...
 

Properties

string? Text [get, set]
 Gets or sets the response text. More...
 
bool IsVisible [get, set]
 Indicates whether the button is shown or not. More...
 
bool IsClickable [get, set]
 Indicates whether the button is clickable or not. More...
 
Response Response [get, set]
 Gets or sets the response associated with this button. More...
 
Transform Target [get, set]
 Gets or sets the target that will receive click notifications. More...
 

Detailed Description

A TK2D response button for TK2DDialogueUI.

Add this component to every response button in the dialogue UI. The button should have, at minimum, a tk2dUIItem. If you also assign a tk2dTextMesh to the label, it will contain the response text. This script adds Dialogue System-specific functionality to the tk2dUIItem button.

Member Function Documentation

◆ OnClick()

void PixelCrushers.DialogueSystem.TK2D.TK2DResponseButton.OnClick ( )

Handles a button click by calling the response handler.

◆ SetFormattedText()

void PixelCrushers.DialogueSystem.TK2D.TK2DResponseButton.SetFormattedText ( FormattedText  formattedText)

Sets the button's text using the specified formatted text.

Parameters
formattedTextThe formatted text for the button label.

◆ SetUnformattedText()

void PixelCrushers.DialogueSystem.TK2D.TK2DResponseButton.SetUnformattedText ( string  unformattedText)

Sets the button's text using plain text.

Parameters
unformattedTextUnformatted text for the button label.

Member Data Documentation

◆ defaultColor

Color PixelCrushers.DialogueSystem.TK2D.TK2DResponseButton.defaultColor = Color.white

The default color for response text, which can be overridden by emphasis tags.

◆ label

tk2dTextMesh PixelCrushers.DialogueSystem.TK2D.TK2DResponseButton.label

The text mesh that will display the response text.

Property Documentation

◆ IsClickable

bool PixelCrushers.DialogueSystem.TK2D.TK2DResponseButton.IsClickable
getset

Indicates whether the button is clickable or not.

true if clickable; otherwise, false.

◆ IsVisible

bool PixelCrushers.DialogueSystem.TK2D.TK2DResponseButton.IsVisible
getset

Indicates whether the button is shown or not.

true if visible; otherwise, false.

◆ Response

Response PixelCrushers.DialogueSystem.TK2D.TK2DResponseButton.Response
getset

Gets or sets the response associated with this button.

If the player clicks this button, this response is sent back to the dialogue system.

The response.

◆ Target

Transform PixelCrushers.DialogueSystem.TK2D.TK2DResponseButton.Target
getset

Gets or sets the target that will receive click notifications.

The target.

◆ Text

string? PixelCrushers.DialogueSystem.TK2D.TK2DResponseButton.Text
getset

Gets or sets the response text.

The text.


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