Search Unity

TextMeshPro ScrollRect overflowMode

Discussion in 'UGUI & TextMesh Pro' started by ciathyza, May 30, 2018.

  1. ciathyza

    ciathyza

    Joined:
    Aug 16, 2015
    Posts:
    109
    Can somebody explain how to use TMPro with ScrollRect overflow mode?

    When using a Unity ScrollRect component the TMPro ScrollRect overflow mode isn't necessary so I wonder what is its purpose otherwise? Is there any use case for it when not using a Unity ScrollRect component and if yes, how is it used?
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The ScrollRect overflow mode isn't working as intended and should be ignored (until I get around to tweaking it). This overflow mode is not needed at all when using a ScrollRect component.

    I suggest taking a look at Example 18 - ScrollRect & Masking Layout included in the TMP Examples & Extras.
     
  3. slowDrag0n

    slowDrag0n

    Joined:
    Oct 10, 2017
    Posts:
    41
    so any update on this?
     
    pragmascript likes this.
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Not really since I am not sure there is still a validate use case for it. If you do have a use case for it please provide more information.
     
  5. slowDrag0n

    slowDrag0n

    Joined:
    Oct 10, 2017
    Posts:
    41
    i have a side panel (not much width to it since its side panel) and i want to show single line text on it. so when text get a bit long i'd like to make it scroll. for example like auto scroll in music player where the title scrolls if its too long to fit.
     
  6. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    You should be able to achieve that with a ScrollView with a RectMask2D component to mask the content outside of the scrollview.
     
  7. slowDrag0n

    slowDrag0n

    Joined:
    Oct 10, 2017
    Posts:
    41
    thanks. woudn't it be nice to be able to do that in a single click tho;);)
     
    bbridgesvb likes this.
  8. Exuro

    Exuro

    Joined:
    Dec 11, 2015
    Posts:
    8
    I feel like having the ability to have a one click solution that allows a textbox to cleanly resize to fit expanding content with a scrollbar is a fairly common use case?

    Obviously you can make it work with other stuff, it's just a little odd that TextMeshPro supported this at one point but now there's just a useless option for a common use case that doesn't work
     
    syscrusher likes this.
  9. Layarion

    Layarion

    Joined:
    Jun 5, 2020
    Posts:
    10
    This should be removed from the drop-down then, because I've been searching google trying to figure out how to use this overflow feature.

    I too was hoping for a 1 click answer.
     
    Last edited: Jul 8, 2020
  10. Gladyon

    Gladyon

    Joined:
    Sep 10, 2015
    Posts:
    389
    I agree that it should be removed.
    Unfortunately it's not possible to have a one-click solution, how would it know the look of your scrollbars?
     
  11. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I have not looked at this in a while. Since I am now working on a new preview release (ie. adding new stuff) this might be the time to revisit this.

    Can you all please provide some insight on how you would envision this one click button to work / do? Just want to make sure I understand correctly and implement as desired :)
     
  12. civil1

    civil1

    Joined:
    Oct 4, 2016
    Posts:
    1
    I'm not one of the original posters here, but the way I would imagine this working, would be the details for the (if required) scrollbar appearing below the dropdown menu.
    The scrollbar itself ingame would only appear when the text runs out of room, and then would function the same as a regular ScrollRect (with masking? maybe as a checkbox?)

    For example, in the attached, I have a text field that I aim to have a small enough amount of text that overflow shouldn't be an issue... but if it did occur, I'd like it to overflow via a scrollbar, rather than having to lose details.
     

    Attached Files:

  13. Gladyon

    Gladyon

    Joined:
    Sep 10, 2015
    Posts:
    389
    I'm afraid that having to specify a toolbar would be far from a 'one-click' solution.
    The only thing which would be a 'one-click' solution would be to scroll the text.
    We would still have to specify some parameters but it would be far faster than configuring a whole scrollbar:
    - is it a left-to-right or right-to-left scrolling?
    - time to wait before scrolling (so the player has some time to read the beginning)
    - scrolling speed
    - time to wait when the end is reached (so the player has some time to read the end)
    - Is it 'circular' or not (I mean, when the end is reached we can continue to scroll displaying the start of the text after the end of the text, or just wait the given time and start again the scrolling)

    We could also have the possibility to scroll using the mousewheel or touch scrolling, without displaying any scrollbar.
    I'm afraid that this solution is not universal, but it has the advantage of being very easy to setup.
    There's only the scrolling speed to specify.
     
  14. slowDrag0n

    slowDrag0n

    Joined:
    Oct 10, 2017
    Posts:
    41
    as i tried to explain earlier. one use-case that i ran into was that i was trying to show line of text in side panel and the text wouldnt fit. it would be cool if there was option for auto-scroll. like the text automatically scrolls horizontally as it does in many music players.
     
    Skaltum likes this.
  15. OVR_Tech

    OVR_Tech

    Joined:
    Feb 23, 2018
    Posts:
    1
    If Overflow is set to Scroll Rect, only text in the bounds of the text box would be visible. If there is overflow text, you could click and drag the text to scroll. Would be super helpful for dynamically sized text boxes which are a pain to use with the Scroll View
     
  16. OneManEscapePlan

    OneManEscapePlan

    Joined:
    Oct 14, 2015
    Posts:
    222
    @Stephan_B If the feature doesn't work, please remove it. You can always add it back later. Right now it just creates confusion. TMP is not a Preview or Experimental package and should not be displaying non-functional features.
     
    BloodArioch, AShenawy, Novack and 2 others like this.
  17. DriesVrBase

    DriesVrBase

    Joined:
    Mar 24, 2020
    Posts:
    65
    is this fixed already? I'm still having the issue 3 years later?
     
  18. InteractivaStudios

    InteractivaStudios

    Joined:
    Apr 28, 2013
    Posts:
    19
    I'm baffled this issue still exists, and the option hasn't been removed despite being non functional. @slowDrag0n and @OneManEscapePlan have pointed out the issue quite well.
     
  19. Gangsta-Geek

    Gangsta-Geek

    Joined:
    Aug 11, 2012
    Posts:
    32
    any word on this?
     
  20. prabhukaran

    prabhukaran

    Joined:
    May 5, 2019
    Posts:
    17
    Any update on this, will help my project
     
  21. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Will try to look at this over the new few days.
     
    gooby429 likes this.
  22. NiXoNiXoN

    NiXoNiXoN

    Joined:
    May 10, 2021
    Posts:
    1
    gooby429, rcFMS and DriesVrBase like this.
  23. bdae

    bdae

    Joined:
    Dec 24, 2017
    Posts:
    23
    I would also like this feature working
     
  24. Umresh

    Umresh

    Joined:
    Oct 14, 2013
    Posts:
    56
    Hi, @Stephan_B any update on this. Workaround with scroll rect works but the caret is in the wrong position after scroll. TMP_InputField works fine in the editor but in build the text doesn't scroll as we text.
     
    Last edited: Jun 10, 2021
  25. tubelightboy

    tubelightboy

    Joined:
    May 12, 2020
    Posts:
    9
    So, is it out? I am using unity 2019.2.17f1. I am looking for a way to give the text a marquee effect when it runs out of space
     
  26. Gladyon

    Gladyon

    Joined:
    Sep 10, 2015
    Posts:
    389
    Haven't seen anything about it, but again it's not sure that a generic solution is really possible, the effect you want probably depends on your project.

    I ended up by using the 'Ellipsis' mode and checking the 'isTextTruncated' property and I automatically add a tooltip displaying the full text when necessary.
    That way if the texts ends with '...', the player knows that he has to display the tooltip to read the entire text.
     
    tubelightboy likes this.
  27. Simetri_Nick

    Simetri_Nick

    Joined:
    Oct 23, 2020
    Posts:
    3
    So if the "Scroll Rect" overflow option doesn't work, why is it still included in the package?

    You want a use case, here is a use case:

    I downloaded TMP and want a text box that automatically adds a scroll bar when the text overflows. Don't include it in the official package if it doesn't work / do anything, AND you don't plan to fix it.
     
    Novack, trombonaut and MadMojo like this.
  28. migs_jelly

    migs_jelly

    Joined:
    Jan 17, 2021
    Posts:
    1
    Any news on the issue?

    We're also started to experience this issue a lot recently (thousands of error reports daily). The main change that we had is a migration from Unity 2019 to 2020.3.14.
    From our logs we see that this issue occurred even before the migration, but since the migration the error count is spiking.

    Unfortunately we weren't able to reproduce the issue on our test devices so it's pretty hard to resolve it blindly.
     
  29. MadMojo

    MadMojo

    Joined:
    Oct 16, 2014
    Posts:
    19
    @Stephan_B
    Any update on this yet? It really makes no sense why this is being teased and shown as a simple solution, when it does nothing. It makes more sense to actually implement this solution properly within TextMeshPro, as the feature notes it should be possible, rather than having to search for a workflow (most of which are outdated) for trying to tie together a bunch of separate Unity UI components (in just the right way) to get the desired, basic functionality for a scrollable text box.

    That I still have to build custom tools that will automate creating a basic, functional UI component (like a scrollable text box) is a bit ridiculous to me. It has been more than three years since this was brought to Unity's attention as an issue. I find it hard to believe that in three years of people taking the time to repeatedly note this is an issue, repeatedly noting it is still an issue and is obviously a desired feature...that no one with Unity seems to understand how important it could be to have an option to just select a scrollable text box within a text box feature.

    Are you trying to tell me no one has thought most modern game projects use a scrollable text box, so maybe it should be simple to implement one? Have you even played a game in the last three years? Because pretty much every single darn one uses it at least for the privacy text boxes displayed at the front of almost all games. And many of them use them inside of all kinds of UI systems from display of inventory item descriptions, to store item descriptions, and more! A simple, standardized way of implementing one quickly seems like a basic part of UI development that should be included to make our lives easier.

    Not only has Unity not prepared an easy-to-use solution, this visible feature that we can see and want to use is completely broken! It _should_ be this easy to setup a TextMeshPro scrollable text box that will just show a horizontal or vertical (or both) scrollbar for the text box when text overflows from the designated text box area. Please address this properly with either a proper solution or remove that option entirely so we don't waste time trying to figure out how to get it to work when it never will.
     
  30. HunterAhlquist

    HunterAhlquist

    Joined:
    Oct 6, 2013
    Posts:
    132
    Unity, just remove the feature already if you're not going to implement it.
     
  31. therobby3

    therobby3

    Joined:
    Jan 30, 2019
    Posts:
    131
    Wow, almost 4 years later and I'm having this issue and it doesn't look like a thing's been done about it judging by this post. I'm confused as to why it wasn't just removed altogether then? Why leave it in if its busted and doesn't even work?
     
    Novack and trombonaut like this.
  32. trombonaut

    trombonaut

    Joined:
    Aug 11, 2021
    Posts:
    10
    Me: Elated, because I don't need to worry about total text content quantity when displaying summarized user input, after having just found the scrollrect overflow option.

    Me after an hour of debugging and googling: $@#$% why is this here after (at least) 4 years since breaking, and 5 years after Unity aquired TMPro?

    Use case as above if anyone is still looking at it, but seriously this vestigial option should be removed from the "finished" package.
     
    Novack and syscrusher like this.
  33. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    I have a very good use case for this feature: Making a WebGL application that displays variable-length content from a database, I have no way to predict whether the LongDescription column will be empty, brief, or multiple paragraphs. The data is of an engineering nature, where some items like a power cord may have a description of "Compliant with IEC C-13 and IEC C-20 standards", but items like an electronic assembly may have a long functional description.

    Many UI libraries offer a "text" field for items like "postal code" and a "text area" field for fields such as "problem description". My assumption when I saw the ScrollRect overflow mode was, naturally, that it made the TMP_Text field work like a text area field.

    Having said that, however, I am posting here to advocate removing the feature from the editor menu.

    I understand that Unity's developers are stretched thin, as we all are, and that this is not a priority especially considering a new UI system is emerging. It is, however, trivial for Unity to remove the option from the editor's dropdown list if it is not going to be fixed in the near term. If the priorities ever allow for this to be implemented, this minor change would be easily reversible.

    I do not mind creating my own ScrollRect to contain my TMP_Text widget. My only complaint is that I spent several hours fruitlessly debugging "my UI configuration" before learning that this feature is simply not implemented. Any one of us who have posted into this thread are likely to have spent more time trying to get this working, than what it would take Unity to remove it from the menu. Thanks for listening. :)
     
  34. OneManEscapePlan

    OneManEscapePlan

    Joined:
    Oct 14, 2015
    Posts:
    222
    @Stephan_B If the feature doesn't work, please remove it. You can always add it back later. Right now it just creates confusion. TMP is not a Preview or Experimental package and should not be displaying non-functional features.
     
    trombonaut and ETGgames like this.
  35. rpuls

    rpuls

    Joined:
    Feb 3, 2017
    Posts:
    101
  36. B33bo_Astro

    B33bo_Astro

    Joined:
    May 10, 2020
    Posts:
    4
    why is it still in then? Just remove it and reintroduce it later
     
  37. RisingSunStudios

    RisingSunStudios

    Joined:
    May 23, 2018
    Posts:
    34
    This is ridiculous - why was it even added in the first place if it wasn't implemented? Talk about shoddy coding practices..
     
    Jelmer123 likes this.
  38. Jelmer123

    Jelmer123

    Joined:
    Feb 11, 2019
    Posts:
    243
    Lol, this is so typical Unity.
     
  39. hookmanuk

    hookmanuk

    Joined:
    May 28, 2013
    Posts:
    20
    Came here to find out how the "Scroll Rect" option works... 5 years later, it still doesn't work, briliant!
     
  40. catalin-ene

    catalin-ene

    Joined:
    Mar 1, 2016
    Posts:
    8
    At this point, I'll probably just do this myself since I bumped into numerous occasions where I want my text box to behave as a scroll view when there is too much text in it.
     
  41. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    Hey now, be fair, the guy is "looking into it"
     
    samousta likes this.
  42. frixton

    frixton

    Joined:
    Aug 16, 2022
    Posts:
    1
    chriscode likes this.
  43. OneManEscapePlan

    OneManEscapePlan

    Joined:
    Oct 14, 2015
    Posts:
    222
  44. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    So who's looking into it now?
     
  45. OneManEscapePlan

    OneManEscapePlan

    Joined:
    Oct 14, 2015
    Posts:
    222
  46. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    707
    Any update?
     
  47. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    Abandoned, but hey, they updated the license and gave us a new splashscreen.
     
    gooby429 and Jelmer123 like this.
  48. Laser50

    Laser50

    Joined:
    Aug 28, 2013
    Posts:
    8
    **knocks on door**

    Y'all still have this useless non-functional option in a package that as far as I know comes by default with Unity.. Wouldn't it be nice to just give some purpose to it? Like, so that it automatically lets us make scrollable text in one easy go?
     
    gooby429 likes this.
  49. jaypad07

    jaypad07

    Joined:
    Aug 27, 2023
    Posts:
    3
    Stephan quit a long time ago and they forgot to take him off payroll. He only replied to make it look like he was still working here.
     
  50. dfblhc

    dfblhc

    Joined:
    Nov 4, 2022
    Posts:
    1
    It's hard to imagine that six years later, Unity will still be able to keep this option and not provide it with actual functionality
     
    trombonaut likes this.