Woah, do you mean... are you disabling the STM component, gameobject, or the mesh renderer itself? If it's the actual mesh renderer, I probably just have some code to make sure it's active, and I hope the other things work correctly... If not, I'll for sure have to give this a peek soon.
Recent community posts
Ah right, I should probably make it disable rendering in this situation... I think the reason it does this is because of how STM evaluates text for auto-wrapping. If the width is 0.001, it'll still put one letter on every line, even if it goes out of bounds, to prevent it from looping forever... so when it's negative, I must have set it to just render the whole thing anyway... so I think disabling the renderer when the width is < 0 is a good solution! I'll mess around with this myself soon and see if I can get it working automatically in the actual build.
Ah, it does, Adrien?? That's really good to hear.
Kev, I made this temporary script to emulate the effect if that solution doesn't work. https://pastebin.com/ixxVjtCH If you attach this to a UI STM object it shooould do it's thing. (I can write the non-UI code if you need it, I just didn't have the time when I wrote this!)
Unfortunately, the outline script I was working on with my friend hit a ton of snags and we have to rethink the whole process. I had an idea, but I can't really give a timeframe on delivery, sorry. Real life and new positions have been starting to get in the way of STM's development.
Here, I went ahead and wrote it up for you!
Add this as a component to your scene, drag in the SuperTextMesh object you're using, and then instead of calling Continue() on SuperTextMesh, call Continue() here! It'll still return false when there's no more text left to show.
I'm still trying to figure out the real solution to this... I might just implement code like this directly into STM or something, because this feels more reliable?
I am still working on it... This is proving to be a really difficult issue to solve and debug in the first place...
For the time being, I have a temporary solution that might work! It's a bit messy, but I understand making stuff work in a certain time frame is super important!
If you set the vertical limit mode to "cut off" instead of "auto pause full", any extra text that's cut off by the mesh will be stored in a variable named "leftoverText". You can take this string and send it back in to .text to emulate Auto Pause Full! You'll know there's no leftover text to show when "leftoverText" has a length of 0!
Not yet, it's proving to be difficult... I'm still stuck on figuring out why text is disappearing at certain points when reading. The position should be "locked" before it even reads out, so I'm not yet sure why it's disappearing when it gets to a certain point.
I opened up Unity today and found that whatever I was going on about last night seems to be magically fixed now... I've managed to reproduce the issue you're having and I'll see if I can get this to work.
Hmm... that should be possible... I'll go in and take another look at this soon! I also realized I didn't actually fix Auto Pause & Auto Pause Full with this update when I was trying to repro this, so I'll try to get them working again, too... Sorry for the inconvenience!
Through the use of automatically-generated custom events, STM does support furigana, or more generically, ruby text!
Super Text Mesh comes with a simple ruby text helper script included in the examples folder (although maybe I should move this to "Utilities" in the next update...) and I've uploaded the code, too: https://pastebin.com/XGKdPccN
Here's a video of it in action:
Is your Super Text Mesh object's rect transform's height (or vertical limit if this isn't a Unity UI element) set to a multiple of (text size * line spacing)? Auto pause full depends on specific values to work, so hopefully it's just that causing this. Let me know if that doesn't fix the issue!
When you say scrollview, do you mean a Unity UI scroll view? If so... check out the "UITest" sample scene to see some masking examples. (It's a bit messy, I know...)
If it's Unity UI, I believe just the parent object needs a Mask attached to it. Then, on the Super Text Mesh object, you can change the Mask Mode from "Inside" to "Outside". The order of objects in the hierarchy plays into masking!
If it's not Unity UI... I'll look into this a bit more! So just lemme know!
Hmm... with regular sprites, I don't believe the shader supports this, but if you're using Unity UI, masking should work! (Try messing with the values exposed on your text material in the material's inspector!)
I can look into seeing what it'd take to allow masking support on the shader exactly, iirc it's something to do with the stencil buffer...?
Hello, unfortunately still no updates. I've been trying to make time with my shader friend but it's proving difficult. I just thought up a really silly idea I could write for you as a quick fix to emulate the old outline shader if you need it ASAP. Let me know if you're interested, I've been fixing a bug today but could shift gears and give this idea a shot.
Oh! It's been a long time since I've worked on this... but I don't think it's possible, unfortunately. It's just using Unity's regular inspector stuff which only supports plaintext. (But colour changes are possible, somehow? Not sure how useful that'd be...) I'm glad people are still getting use of this free asset I made for a tool jam, though!
Nested colour tags (or any tags of the same type, for that matter) are not part of STM... When I first started out programming it was because I didn't know how to do it, but now it's because I believe it's an easier pattern to use.
For example... lets say you want to type the string <c=red>R<c=orange>A<c=yellow>I<c=green>N<c=blue>B<c=violet>O<c=pink>W
To get back to normal text, in STM you'd just have to do </c>. But with nested tags, it's </c></c></c></c></c></c></c>. Another way to think about it is... every <c=x> tag essentially also works as an invisible </c> tag! This also makes it easier to pragmatically type text, since you don't have to remember how many layers of text formatting you're currently on. In addition to this reason, there's a lot of STM users by this point, so changing something like this would cause a lot of problems for a lot of people... I have considered it though.
For your situation, I'd recommend... When finishing the subitem highlighting, use <c=prevcolour> instead of </c>! Or if you are pragmatically generating the text, you can do a replacement script (or STM's pre-parsing loop!) to adjust your string before it's sent to STM. I have some sample code included for parsing custom tags, and I think I could adapt this so it formats numbers instead of tags in the same way.
So... the short answer is... Nested tags don't work because lots of people are using the current tag system, but there's other workarounds you can do to have a smooth typing experience!
If you need any additional programming help, please let me know.
Try creating a wave that uses rotation data, and set the speed to a high number that's *not* a multiple of 60! I believe that should create an effect like what you're after! I added this effect to STM after noticing Super Mario Odyssey used an effect like that for its jittery text!
To clarify, are you enabling the text gameObject or text component? There's a biiit of code that'll be changing in the next update that should finally make the two work exactly the same, but...
In some situations, when enabled, Super Text Mesh will actually take one extra frame to recalculate. It's an old fix to get around a problem with async loading. Using a manual Rebuild upon enable is probably the best option here. (You can disable auto-rebuild in the inspector to prevent it from rebuilding twice!)
Hopefully that works... if there's any further issues I'll take a deeper dive into this!
Is something like this good? You're trying to assign a sprite based on index, right?
using System.Collections; public class STMSetQuadData : MonoBehaviour
public STMQuadData quadData; public Texture textureArray; public void Assign(int index)
quadData.texture = textureArray[index];
Ooh, not a bad idea... it's a bit hacky, but I think if you have a manager script it should be fine... STMQuadData objects are ScriptableObjects which in a build, do not serialize. But as long as you have a script that updates the one scriptableobject in particular before text is rebuilt... I think it should work. Maybe. I'll give it a shot in just a moment!
Hmm... so there's two solutions, here. It all really depends on how you want to do this...
Solution 1: Use a program like photoshop or aseprite, and combine all the sprites into a sprite sheet. Doing it by hand would be a pain, and I remember from my pixel art days that there are scripts out there to do this. If you're searching by index anyway, then it's just a matter of... <q=cardsprites,x>!
Solution 2: Use a script that generates STMQuadData files out of a sprite array. If you want to go with this, I can write the script for you as part of this support! You'd end up with one STMQuadData file for each sprite, but the names could be auto-generated from the sprite's name, so you could have... <q=symbol> <q=othersymbol> etc. I will say, this method is less rendering-efficient, since every unique texture means a unique material.
Either way, using a program to set up 100s of these is what I think should be used! No one should have to define 100+ sprites by hand.
I forgot to mention last time, I have a script included in the sample folder named "STMPagination" that can be used to do this, or used as an example. Here's an updated version (with delegate events instead of requiring UnityEvents) so you don't have to dig through my code: https://pastebin.com/g46WEWvn
I hope this helps!
Check out the "PreParsing" feature of STM. I should have a sample component included called "STMPreParse" that should do exactly what you want. This component will add a specified string of text to any object if its "Parse" method is invoked by STM's PreParse event (It's one of the UnityEvents under the events tab!) Just set the string to <w=custom> and it'll apply that to the mesh when you change its text!
You don't need to use </w> at the end of the string, but "STMPreParse2" can actually do just that, too! Just make the UnityEvent invoke both!
There's been a bit of progress! Here's a low-quality soft shadow, showing off no z-fighting and no blur over top of letters in the single-pass shader! The shader has code that expands the size within the verts without altering the text UV coords to allow room for shadows and it's honestly really crazy that this is even possible.
Progress got halted again because the unity asset store caused me some problems a few weeks back, I wasn't even sure if I'd be able to give customers asset updates anymore so it was a bit demotivational. Hopefully we'll get back to work on the shaders soon! (It's actually my shader friend's birthday today so... maybe not immediately haha)
Also, I thought it was 100% broken, but as it turns out that Super Text Mesh used with Unity UI should still support the current outline/dropshadow shaders. A friend was using it in a URP game the other day with a screen-space canvas, but I'm curious if it'll work with a world-space canvas, too. Try giving that a shot!
This is a good idea, but not directly supported, and I'm not too sure how I would support it... It'd have to be a big update.
But, for the time being, I do have an indirect solution that already works!
Super Text Mesh has a "Pagination" feature, where text from one text box can be set up to automatically overflow into another. So... using this, you can set up multiple single-row Super Text Mesh objects that fill your round speech bubble, then just send the updated text to the first STM in the chain and... bam! Multiple STM objects can work as one.
If you have a static text box that will never change size, this won't take long at all to set up. If you have one that changes size dynamically... this might take a bit longer to set up, but it is possible. You'd have to systemically instantiate STM objects, and assign their position and autoWrap values based on the evaluation of the polygon at a given Y coordinate. If you need help coding this for a circle/oval, I can try to whip up some sample code, but for more complex geometrical shapes, I might have to do a bit more studying...
Okay... I think I've got the right things set up for good playmaker actions, I'm just having trouble translating the genericdrawstring.cs class logic into a grid myself to show it off with right now, haha.
If you want, send me an email and I'll send you a new Fleece build along with the new actions! I'll keep working on this.
Hmm I've been working on this, and I'm having a hard time making this code generic. If the playmaker actions directly influence the Drawstring class, and not the monobehaviour containing them, then it's up to the playmaker user to basically make their own monobehaviour using playmaker... I guess that's okay? The whole... Begin drawstring, update text, wait for input system?
Yeah I guess I'm basically just thinking out loud here, but is that an okay end goal?
Ah yeah, all of these actions work with a specific monobehaviour class... So the STMDrawstring and GenericDrawstring are entirely different things since I dropped inheritence and made Drawstring a standalone class. I'll see if there's any way for me to make this work, perhaps an interface might be able to get this working? "IDrawstring" requiring a "GetDrawstring()" method or something. I'll be messing with that this week hopefully!
Okay, got my hands on a copy of playmaker, and here's an updated begin script:
And here's a screenshot of how everything looks:
The string variable being used is just the name of the starting passage, in this instance I'm using the dialogue tree from the visual novel example scene (I renamed the starting passage to "VN_Start")
The playmaker tree I made there is pretty simple and doesn't have choices, I just wanted to make sure the actions worked! Now to figure out how to tell playmaker when to continue/show choices... I think I can use the UnityEvents to control the tree, maybe...
I think I might have got the fix for this but I'm not 100% sure. Found a bug where quads weren't sharing submeshes where they should have been and fixed that. Please send me an email so I can send you an updated build to test!