Selecting a response through a custom button

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
ilmeri
Posts: 2
Joined: Mon Jan 23, 2023 6:10 am

Selecting a response through a custom button

Post by ilmeri »

Hi,

We have dialogue where we would like the player to be able to select a response option by clicking a custom button element - for example two team logos representing choices for teams the players can join. Is this possible?
User avatar
Tony Li
Posts: 22137
Joined: Thu Jul 18, 2013 1:27 pm

Re: Selecting a response through a custom button

Post by Tony Li »

Yes. The easiest way is to use TextMesh Pro (see TMPro Support) and <sprite> tags in your response dialogue entries' menu text to show team logo images inline with your text.

However, if you want differently-styled buttons than your regular dialogue UI, create a separate response menu panel in your dialogue UI, or a separate dialogue UI entirely. (See Dialogue UI Tutorial if you need details.) In either case, set up your two team logo buttons and assign them to the StandardUIMenuPanel's Buttons list, making a note of the element number of each one (i.e., 0 and 1). To assign the first response to use button 0, include the markup tag [position=0] in the menu text. Use [position=1] in the second response's menu text.

If you've set up an additional menu panel in the same dialogue UI, make sure to add it to the StandardDialogueUI component's Conversation UI Elements > Menu Panels list. To tell the dialogue UI to use your custom menu panel, use the SetMenuPanel() sequencer command or a Dialogue Actor component on one of the participants whose Dialogue UI Settings > Menu Panel Number is set to the menu panel number in the Menu Panels list.
ilmeri
Posts: 2
Joined: Mon Jan 23, 2023 6:10 am

Re: Selecting a response through a custom button

Post by ilmeri »

Ok, thanks! I'll give it a go!
User avatar
Tony Li
Posts: 22137
Joined: Thu Jul 18, 2013 1:27 pm

Re: Selecting a response through a custom button

Post by Tony Li »

Sounds good! If you have any questions about it, let me know.
Post Reply