This is ultimately the same bug as existed with <e>pause<e> in the past. I fixed it by inserting the \u200B character, as you did in the code for <pause>.
draque
Recent community posts
Yup, I've made a parameterized system that works very similarly to this!
Last question, but when I <pause> (which I used to do via something custom), calling stm.Continue() only moves things forward by one aditional character. How do I tell it to start reading normally again? I have some text with multiple pauses in it. What I'm doing is making a custom tag that calls continue in X seconds via a coroutine, then hitting the <pause> tag. It pauses, but when Continue() is called, it prints a single character without returning to normal auto reading cadence.
EDIT: Alright! Figured this one out on my own. I had been handing delay float values, which causes it to be ignored, but it accomplishes exactly what I was. looking for. Thank for all the help here!
All your suggestions are great! One suggested addition to the SuperTextMesh class:
public void ClearAllEvents()
{
onCompleteEvent.RemoveAllListeners();
OnCompleteEvent = null;
onUndrawnEvent.RemoveAllListeners();
OnUndrawnEvent = null;
onRebuildEvent.RemoveAllListeners();
OnRebuildEvent = null;
onPrintEvent.RemoveAllListeners();
OnPrintEvent = null;
onCustomEvent.RemoveAllListeners();
OnCustomEvent = null;
onVertexMod.RemoveAllListeners();
OnVertexMod = null;
onPreParse.RemoveAllListeners();
OnPreParse = null;
}
Ahh, I will explore those, thanks! I will need to see whether there's a good way for me to get passable parameters into the tags in a way that I'm able to use, but I think I can figure something out there. The OnPrint() event coupled with that method for pulling the last character should work as well...
Anyhow, have a good trip and thanks for typing this out before you headed off! It absolutely saved me a ton of trouble!
Hello again! I am working to integrate SuperTextMesh more fundamentally into my game and take advantage of more of its features. I am hoping that it's possible to do the two following things without modifying the source code for STM itself.
1) Receive a callback/notification on the printing of each character which includes which character was printed
2) Receive callbacks for custom tags consumed by SuperTextMesh, which will not be printed to the screen.
The first ties into my speech generation system (custom bleeps and bloops) and the second ties into a system which plays custom animations, updates character expressions, etc. in time with the text. Please let me know if there's a way to do this or if there are any plans to integrate features like this. Conversely, if there is a way for me to simply extend the class in a way that achieves this, I am 100% open to that as well. I'm no stranger to coding and if I can just drop something into place that pre-consumes necessary elements, passing others up to super, I will do that as well.
And again, thank you for making a killer product! :3
EDIT
Ok, I have been exploring ''string ParseText(string myText)'' a bit. Here's something I can think of that would let me do what I need, and it hinges on the code which handles tags, ''switch(ParseText_myTag){'' (line 2640 in the build I am using).
Create an interface for a handler class which is called to each time an unrecognized tag leads to the switch's default statement. If a class which implements this interface is handed to the SuperTextMesh, will will call out to a method ''bool UnrecognizedTag(string ParseText_myTag, string ParseText_myString)''. The return value will be used to set ''clearAfter'' and in the case that there was no handler class provided, it would default ''clearAfter'' to false.
I feel like something very similar could be done by using another method in the same handler class to communicate back each time a character was printed to the textbox.
If you have a repo for STM and you would like me to implement/submit this myself, I would be happy to contribute to a project like yours!
ADDITIONAL EDIT: I'm actually working on implementing this in the SuperTextMesh code now... I will just hand you any code that I create for use in the official project if you would like it!
EDIT X3: Alright... so this still leaves the issue of timing. The tags are parsed immediately, rather than at the point where they would be encountered while printing text... still looking for a way around that.
Ok, if you remove the word "test" there, the sentence you're asking about makes more sense. I think that was the victim of late night editing XD.
Anyhow, I do have my own tagging system that I am using as well, which is part of a larger scripting system that my game consumes. Everything is tokenized as part of a fairly complex system that I build before integrating STM. I will have to think on this, since this is kind of the merger of two pretty complex systems. The superTextMesh.leftoverText.Length seems like it might be what I'm looking for. Ultimately I would like to have my text in a box that can scroll upward indefinitely, but stops after it has filled. I think I'll do that with an identically sized text box which is hidden. I'll print to both until I find something in the leftover text, then pause, clear the hidden box, and wait to go again once I get player interaction.
I don't think it would be possible to get the effect I'm going for while using 100% of your features unless I integrated the two systems together unfortunately, and that would mean I couldn't snag new STM versions easily. Still, I'm getting the hang of this, and all the features I was sold on work great. ^^
Thanks for the quick responses! :3
Is there a SuperTextMesh equivalent to the isTextOverflowing property that's found in child classes of TMP_Text? I am printing additively to my STM object (due to how speech sounds are generated), and and looking to create a text pause each time the text box fills up.
As an additional detail, I'm not using the built in test printing functionality in part due to the scripting system that exists in my text. It is tokenized and consumed in a way that doesn't work with the STM printing system.
Any pointers appreciated!
Hrm, I am pretty sure that it's a rect mask, since those are compatible with scroll bars...
Do you possibly have a link to example code to show how this is best done? I have been looking through github to try to find examples but am having some trouble. Specifically, all examples I find online presume that all text will use rect masks, which is how I currently have it set up. They limit vertical movement automatically to just the size of whatever is contained within them, which is really nice. It seems like the size of the SuperTextMesh box is not defined in the same way as a TextMeshPro box though, which is what prevents theRectMask from recognizing where it's able to scroll to.
Ok, striking everything I said there... I am using a normal mask rather than a rect mask. It's not detecting that the text is longer than the current view port, so when I try to scroll down, it snaps back up. If you look at the example below, you'll see that the box never detects that its boundaries have content which has expanded past them, and the vertical scroll bar remains hidden, despite this. When I stash my current progress with git, all settings are the same, but with a TMP, and it functions normally.
VIEWPORT SETTINGS:
STM Settings:
RESULT:
When I try to scroll down, it moves slightly, then snaps back.
Is there an example of the best way to make scrollable text? I am replacing TextMeshPro objects with SuperTextMesh ones, and they do not seem to get along with a ScrollRect/Viewport/Mask setup. Essentially it is just a dialog box, but I would like the player to be able to scroll back in the conversation if they choose to. I am thinking that rather than adapting SuperTextMesh to this previous setup, I should just re-do this part completely. Is there any good code or example projects I can look at where this is done?
I looked in the examples folder and did not see anything there that quite did what I needed. Thanks!
Ok... replying to my own post here with what I believe is the correct answer. If this is correct, it might be good to include in the installation instructions. I know this is pretty basic, but for anyone new to Unity, it might be pretty esoteric.
- I went to Assets/ClavianSuperTextMesh/Scripts
- right click->Assembly Definition and name it SuperTextMesh
- Go to the Assets/Scripts folder
- Select Main assembly file (NOT script named main, but the file with a puzzle piece)
- Add a new Assembly Definition in the Inspector
- Set new Assembly Definition to SuperTextMesh
If this is the wrong way to go about it, please let me know. This seems to be what it needed, though.
I'm trying to manipulate SuperTextMesh objects in code, but running into issues with the object types not being recognized. I'm fairly new to Unity and feel like I must be missing something pretty simple in regard to having SuperTextMesh be recognized in the main assembly, but am kind of scratching my head here. I have already imported it into Unity and am able to use SuperTextMesh objects in the scene editor, but when I pass them as objects into scripts and try to snag them like this:
public dialogText;
. . .
var Text = dialogText.GetComponent<SuperTextMesh>();
I'm given the error "SuperTextMesh is not a Unity Component"
I have watched the tutorial video, and at the linked time, it shows the object being used without issue. I don't believe that I missed any steps in the manual for installation, so I am wondering whether there's something else that might be wrong?
Could someone walk me through this one? I have looked through the installation and do not see anything there mentioning this. Any assistance much appreciated! : )