Skip to content

New extension: Enhanced Yarn Wrap #1986

@Silver-Streak

Description

@Silver-Streak

Description

While waiting/hoping for the issue listed here to be resolved, I had an idea of how to implement it via an extension.

By default, due to how Yarn's clipped text works, word wrap will only happen after the maximum width is hit. This means there are partial words typed out before they jump to the next line, which is jarring and unprofessional for dialogue.

This extension will allow someone to define a "maximum characters before wrapping" then use the full Dialogue Line to calculate where all linebreaks should be for full words. It then does some math and substrings to build out the proper output expression, using the Clipped Line to keep the typing effect. The events support up to a maximum of 8 lines, and should not be used with trigger once otherwise they cannot behave like the standard ClippedText expression.

This has been tested and works with BBText, Bitmap Text, and regular Text objects.

How to use the extension

  1. Set up your text object with your desired font and text site.
  2. Add the text object to the scene, sized to the desired width.
  3. Add an example/placeholder text.
  4. Manually count the number of characters before the line wraps, or copy the placeholder text from before the wrap into a character counter. This is your maximum line characters.
  5. Set up yarn dialogue events as described in the wiki and the existing examples.
  6. Instead of setting your text object's text to the normal DialogueTree::ClippedText(), set it to EnhancedYarnWrap::ClippedText()

Checklist

  • I've followed all of the best practices.
  • I confirm that this extension can be integrated to this GitHub repository, distributed and MIT licensed.
  • I am aware that the extension may be updated by anyone, and do not need my explicit consent to do so.

Example file

YarnWrap.zip

Extension file

EnhancedYarnWrap.json.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions