-
Notifications
You must be signed in to change notification settings - Fork 68
New extension: Enhanced Yarn Wrap #1987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Thank you for submitting an extension. Does this extension only work for monospaced fonts? Have you checked how the auto-typing extension work around this? |
From my testing it should work for any font, albeit the dev will need to manually find what they want the safest character count to be (i.e. they should set it to wrap at the least amount of characters that are reasonable to avoid lines that get wrapped too late) Unfortunately, the auto-typing extension in question didn't seem to work for Yarn dialogue line based text at all, and also still had instances where some characters were typed on line 1 before wrapping the word into like 2, so visually it would jump between the lines. I tried to debug that before I went too far into building something new, but it looked like it had to do foundationally with the way the formulas were set up (best guess was that it was only checking one character ahead rather than finding the latest start/stop of a word?) Since I explicitly wanted something to address needs around Yarn dialogue text (i.e. could work explicitly within normal Yarn dialogue event setup without needing anything extra done so it could be drop in-place), it didn't make sense to further try to debug that visual behavior on the other extension. |
The auto-typing behavior writes 1 word ahead and if the text object height changes, it reverts it (before it get displayed) and put a line break instead. Just to make sure, you tried the auto-typing behavior without Yarn own auto-typing, right? Because using 2 auto-typing at once will only add up the bugs from both of them. Do you still have the test project reproducing issues with the auto-typing extension?
The issue is that "i" is smaller than "m" unless the font is monospaced, so some lines will be too short. |
Correct, I was testing using just regular text thrown into a text object, and also tried via setting the object to the LineText expression for Yarn rather than Clipped text, which had a lot of complexity to work at all compared to just using normal Yarn events. At that point I stopped investigating as my goal was to integrate this into existing Yarn event workflows rather than replace them. I don't have the example project anymore because I quickly gave up on it after the initial investigation, but I'll see if I can reproduce it later this week if desired, although that wouldn't replace this being a separate extension for the above reason.
Yes, this should still work fine so long as the dev finds the right character minimum count for wrapping, some lines will be shorter but only by a few characters. |
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
Checklist
Example file
YarnWrap.zip
Extension file
EnhancedYarnWrap.json.zip
Extension by @Silver-Streak
You can update the extension on this "Pull Request" by commenting the update command: in the comment field, type
!update, then drag and drop a zip file with your extension file in the commenting field, like how you initially submitted the extension. It should look like this:It can take a few seconds for the file to fully upload and show as the above. Once it is like shown above, click "Comment" and let the bot do the rest!