Forum rules - please read before posting.

Possible to wrap Journal text onto a new page automatically?

I was wondering if there's a way to have a Journal page's text automatically "wordwrap"/go onto a new Journal page, rather than have it overflow out the bottom. Perhaps there's a tutorial relevant to this? (using Unity UI or a Custom Action?)

If not, what is the best way to know how a section of text will look/fit on a Journal page? Copy-paste each one into the "Placeholder text" box and see how it looks?

(image probably not necessary but figured I'd share)

Thanks!

Comments

  • It's possible to do this with Text Mesh Pro, which AC integrates with:

    https://forum.unity.com/threads/tmp-double-column-possible.1135438/

    This involves creating two TextMeshProUGUI components and linking them together. If you link the first one to an AC Journal element, it should work with your journal text.

    You'll need to use Unity UI for this, and if you make use of Text Mesh Pro in AC then you'll have to do so for all text in Unity UI-based Menus - but I recommend doing so anyway.

    To make use of Text Mesh Pro in AC, import it as a package and then type in "TextMeshProIsPresent" into the "Scripting Define Symbols" box in Unity's Player settings. That will then amend AC's UI Text fields in the Menu Manager to TextMeshProUGUI fields.

  • edited October 2021

    Hey, I'm having a problem with the text disappearing when the game is played. For whatever reason, when the Hotspot is clicked and the menu is turned on, the text in the "Text Input" Inspector box is erased. Any idea what is going on? I'm not exactly sure if this is related, but I don't think so.

    Gif showing the text disappearing (ignore the "why doesn't link text stay linked" text box, it does stay to seem linked; the issue is the text disappearing)

    Pic showing the actionlist that runs to open the menu (pretty unimportant but I figured I'd share it)

    Naturally, let me know if more info / screenshots are needed. Thanks.

  • It's not a case of it appearing in the Scene window but not the Game window - there's no text in the component Inspector.

    What element is this object linked to in AC's Menu Manager? Are you using a Document or a Journal?

    To rule out this being a UI / TMPro issue, temporarily switch your Menu's Source to Adventure Creator and roughly configure its appearance so that you can see if things show up correctly in the Game window.

  • edited October 2021

    (sorry for taking so long to reply again, dealing with some stuff)

    1) I am using a Journal element, with Display Active Document and Linked Text.

    2) If I use Adventure Creator instead of Unity Ui In Scene or Prefab, things work correctly (at least when using New Journal, or the placeholder text showing when using Display Active Document). Does that mean it's likely a UI / TMPro issue?

    edit: I wasn't originally using the text in a Document. I put the text in a Document, set the menu to open for a Document instead of Manual, and use Document Open and then Turn On Menu. I can get the text to display but it just overlaps itself and doesn't go across multiple pages like I'm trying to accomplish. Images

    Some screenshots

    (What I'd like to accomplish (and maybe it goes without saying) is have a menu prefab that can have different texts. For now I'm using "Unity Ui In Scene" however.)

  • edited October 2021

    I think I could have been more clear on things in my first reply - apologies for this.

    A single Journal element can only display a single Journal/Document page at a time. It's possible to display multiple pages by having multiple such elements, but the text contents of a page is fixed.

    If you want to have your journal text naturally flow onto multiple pages (accessable via the Menu's left/right shift buttons), then you will need to manually arrange the text into separate pages. There's a separation between a Document's page text and its appearance on-screen - it can't "predict" how much of the text can be shown at once.

    The link I posted above deals with an alternative means of displaying your Document/Journal text. Rather than defining multiple pages for your text, you'd instead put it all into a single page and rely on TMPro's column feature to automatically spit it into multiple TMPro components. To show these components one at a time, you'd then have to rely on e.g. some scripting or animation to control their display. As AC wouldn't strictly be involved here, I'd recommend trying this out in a fresh scene / project with just TMPro.

  • Thanks for clarifying. :smile: So it sounds like what I want to accomplish would require a bit of extra coding and essentially be creating my own menu / document-journal system specifically for this (outside of AC; something like using Canvas and moving objects that have TMP components on and off screen). I think I could figure it out, but I'll focus on things more important to the kind of game I want to make (definitely not a text heavy one)

  • You should be able to accomplish it with a bit of both - you can still rely on AC's Documents system, but keep things to one page and use a custom script to dictate which column is displayed with TMPro.

  • Okay; I kind of have a rough idea of how I'd do that. For now I won't worry about it. Cheers.

    Something I may try to figure out in the future is letting people write their own notes in-game in a journal, but that's for a different thread of course.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.