Hi all, I am creating a dialogue system using the WRPG template and I am having some difficulty designing distinct NPC and PC subtitle styles - particularly it is the way the two players' messages stack vertically:
In the screenshot, you can see the issue I'm having is that NPC text accumulates entirely on top of PC text, which accumulates below, as opposed to the two kinds of messages stacking alternately with each new line.
Here is my hierarchy:
I have two separate TMP objects and Subtitle Panels, one for each character.
Here is the setup for my Standard Dialogue UI component:
What do I need to revise in order to support both player subtitle styles, while ensuring that text accumulates properly?
Thank you
WRPG with distinct NPC and PC subtitles
Re: WRPG with distinct NPC and PC subtitles
Hi,
The WRPG template is designed to use a single subtitle panel that accumulates all conversation text in a single Text/TextMeshPro/SuperTextMesh element. If you want to use separate elements for the NPC and PC, consider using something like the SMS Dialogue UI template instead.
Or, to continue using the WRPG template, set it back to using a single subtitle panel and text element, and switch to using TextMesh Pro (see TextMesh Pro Support). Add a script to the Dialogue Manager that adds right-alignment rich text tags to player lines:
The WRPG template is designed to use a single subtitle panel that accumulates all conversation text in a single Text/TextMeshPro/SuperTextMesh element. If you want to use separate elements for the NPC and PC, consider using something like the SMS Dialogue UI template instead.
Or, to continue using the WRPG template, set it back to using a single subtitle panel and text element, and switch to using TextMesh Pro (see TextMesh Pro Support). Add a script to the Dialogue Manager that adds right-alignment rich text tags to player lines:
Code: Select all
using UnityEngine;
using PixelCrushers.DialogueSystem;
public class RightAlignPlayerSubtitles : MonoBehaviour
{
void OnConversationLine(Subtitle subtitle)
{
var text = subtitle.speakerInfo.formattedText.text;
if (subtitle.speakerInfo.isPlayer && !string.IsNullOrEmpty(text))
{
subtitle.speakerInfo.formattedText.text = $"<align=\"right\">{text}<align>";
}
}
}
Re: WRPG with distinct NPC and PC subtitles
Switching to the SMS template has helped - thanks
Re: WRPG with distinct NPC and PC subtitles
Glad to help!