Forum rules - please read before posting.

Subtitle issues in Unity 2023

Often times the dialogue crops a bit when it is 3 lines tall. any ideas? I recently updated to unity 2023. In 2022 the dialogue boxes were sometimes too tall, now they are too narrow.

Comments

  • I can send project if required. Screenshot taken in a build game on M1 Max.

  • What are your exact AC and Unity versions, and how are you rendering the Menu? The most reliable way to render dynamic content is to use Unity UI and its Content Size Fitter component.

  • I am using Adventure creator to render the subtitles- Unaltered adventure creator (latest version) and unity 23.1.11f1.

    I am not a big fan of Unity UI as I can not reliably limit the width of the UI element while keeping its width dynamic so that it will correctly align at the screen edges. I did manage to make it work, but then the subtitle Ui always flashed at the centre of the screen before being correctly repositioned. But this was in 2022. Maybe 2023 has fixed this issue. I will need to redo my tests.

  • edited September 2023

    The "Adventure Creator" source option relies on Unity's ImGUI system, which doesn't offer as much control over Unity UI, and is a little "at the mercy" of Unity itself.

    In general, I find it best to use for rapid prototyping, with "Unity Ui Prefab" better for final design.

    Creating a UI Text object that has a "flexible but maximum width" is indeed trickier than we'd all like - but it is possible. An example GIF on how to set this up can be found here:

    https://forum.unity.com/threads/limit-max-width-of-layout-component.316625/#post-2505227

    but then the subtitle Ui always flashed at the centre of the screen before being correctly repositioned.

    This sounds like an old issue that should be now fixed, though if you still have it - checking Duplicate for each line? in the Menu's properties should improve results.

  • perfection. I will transfer over to the unity UI 💪

  • Yes, I can happily report that the flickering subtitle issue using this max with trick has been fixed in the latest version of adventure creator!

  • Actually no, I can still see a flicker of the subtitle element at the centre of the screen before it gets picked up by adventure creator an placed correctly. When using a container to set max width, but moving the child subtitle panel instead so it properly hugs the screen edges.

  • What's your AC version, and which object in the Canvas prefab have you assigned in the Menu's RectTransform boundary field?

    Is Duplicate for each line? checked? Try attaching a Canvas Group component to the prefab's root, and assigning a Fade transition with a very small duration, e.g. 0.05.

  • I will try to explain this better with examples. The easiest would actually be to jump on like a google meet etc so I can easily explain this, but I can also do a step by step. It might be an issue with getting the text to work how I want it to, or I might be just doing something stupid.

    My AC version is 1.78.4
    I have a structure like so:
    canvas
    -maxwidthelement (to clamp the text panel width)
    --textpanel <- rect trasform boundary

    if I set the rect transform boundary to the maxwidthelement, the max width is no longer clamped and the text is one long line. But there is not text box flicker.

    if I set the transform to --textpanel, the text is positioned correctly, the width is clamped, and when under the width limit, the text box neatly hugs the screen edges.

    If I set the transform to the canvas root, the subtitles appear at the centre of the screen.

  • edited September 2023

    Thanks for the details.

    I've recreated your setup and have the same issue - looks like the GIF I posted above isn't appropriate here, after all. Apologies.

    The issue is to do with the assigned RectTransform boundary. It's this that AC will reposition, and it will rely on its width to work out how to keep it within the screen.

    The above GIF involves keeping the Canvas's immediate child (which will need to be the "RectTransform boundary") at a fixed width.

    Instead, we need an approach that allows this to have a max width, but can also be smaller if appropriate.

    I've tested a few of the other suggestions in the above thread, and this one gives me the best results:

    https://forum.unity.com/threads/limit-max-width-of-layout-component.316625/#post-6614209

    To get it working on my end, I did the following:

    1. Have the structure as Canvas, Panel, and Text - all children of each other
    2. To the Panel, attach a Vertical Layout Group with both Child Controls Size options checked
    3. To the Panel, attach the link's Content Size Fitter With Max component, setting both Fit fields to Preferred Size, and Max Width to the intended size.

    This approach allows the Panel to change in size according to the Text child, but not being a maximum width. This Panel can then be properly controlled by AC when assigned as the RectTransform boundary.

  • Absolute perfection! I will try this implementation as well and report back at you.
    Thanks for taking the time on this, I truly appreciate it!

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.