Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

an isTextOverflowing equivalent?

A topic by draque created 24 days ago Views: 31 Replies: 3
Viewing posts 1 to 4
(2 edits)

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!

Developer

Hm I suppose that would be "superTextMesh.leftoverText.Length > 0" as an equivalent to that boolean, but also if you set the cut off mode to "Auto Pause" or "Auto Pause Full", Super Text Mesh has that built-in if I'm understanding what you want to do correctly. Just call superTextMesh.Continue() to have it keep reading past the pause. (This works with the <pause> tag, too!)


What do you mean by "built in test printing functionality" and the scripting system in your text? Are you using your own tagging system? STM should be compatible with a lot of stuff since it's programmed to be generic in use, so would it be possible to use that? You can use pre-parsing in STM to convert your own tags to things STM would recognize if you have an entire script written up for your game already! I may be able to point you in the right direction if that's the case!

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



Developer (1 edit)

If you go into the sample scene for "links", you can see some code there for how to convert existing tags to STM ones... (e.g. <link=myLink> becoming <e2=linkSpawnEvent> etc) That way, you can keep the system you have, and just convert it for the text renderer.


I think the "Auto Pause Full" feature would work well for what you're trying to do, but it's also possible to just manually take the leftoverText field, and send that to a new box when you continue, too... (I would advise this if the text gets *really* long! And look at the "pagination" scene for an example on doing this, too) STM is just a renderer, so you have a lot of control over how to integrate it into *your* system.