Forum rules - please read before posting.

ChatLog Dilalogue Portrait

edited December 10 in Technical Q&A

Im using the ChatLog Template and have one question: Is there any way to add graphics like dialogue portrait in original AС menu?

Comments

  • You can do this by assigning a Sprite Asset in the "TextMeshPro - Text" component of the ChatLogUI's Content object, which is the field that displays the log's text.

    Have this asset include your various portrait graphics, with a fixed naming convention of "Portrait_(Character name)", e.g. Portrait_Player, Portrait_Steve etc.

    To then insert these sprites to the front of any speech line, open up the template's ChatLog script and find the following arond line 461:

    return lineText;
    

    Just above it, copy/paste:

    lineText = "<sprite name=\"Portrait_" + Speech.SpeakerName + "\">" + lineText;
    
  • thank you! Can I manipulate the size and position of the sprite?

  • edited December 12

    You can adjust the Sprite's "Pixels Per Unit" setting to control its size.

    For position, you may have luck with adjusting the sprite's border and pivot point in the Sprite Editor, but I'm not 100% sure how TextMesh Pro reacts to such settings when inserted into a Text box.

    You can, however, adjust the line-change above with some padding or a line-break if needed, i.e.:

    lineText = "<sprite name=\"Portrait_" + Speech.SpeakerName + " \n\">" + lineText;
    
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.