Post by jspro on Dec 1, 2021 8:37:13 GMT
Greetings,
I've recently purchased this asset for a small project of mine, and was hoping I'd get some pointers on the best way to approach the above problem.
To be a bit more thorough, I'd like to use this asset as a notebook/journal that's constantly being updated. Sentences can be multiple lines long, and some are interactable (as buttons). Finally, the notebook is initially empty, and the order of the entries depends on when (and if) they're discovered, so I can't produce a million textures. Using an overlay canvas is possible of course, but doesn't look very good.
After going through the documentation and project files, I can see how both of the above problems can be solved individually:
Just Interactive:
- Setting up colliders on the fixed page, as done in Demo 2.
And,
Just Dynamic:
- Set up a Camera Canvas.
- Write a script to generate text when necessary, according to game design.
- Use a render texture to capture the result produced by the canvas.
Now, to do both of these together, I've thought of the following idea (which is essentially combining the two approaches together); it seems tedious, however, and therefore I just want to check if there's nothing else I can do before moving forward with it:
Dynamic + Interactive:
- Generate the dynamic canvas as described.
- While generating the canvas page, also keep track of some meta-info per UI entry. Such as the number of lines (to determine the size of the box collider), width of the paragraph, if it's interactable, etc.
- Use the meta info to set up the box colliders on the resulting texture.
This, however, means I lose out on TextMeshPro, but that's acceptable if there's no other way. So I guess I have two questions:
- Is there an easier way of doing this?
- Is there an easier way of doing this while keeping TextMeshPro?
Best,
Malek
PS: I'm a big fan of the Signaler, well done on that!