That was the trick to it, thank you!
draque
Recent community posts
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! : )