Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

TextMesh Pro New user comments, feedback and questions :)

Discussion in 'UGUI & TextMesh Pro' started by methos5k, Apr 6, 2017.

  1. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,713
    Hey there. I'm very much looking forward to using TextMeshPro. I look forward to it being integrated into Unity. I was almost going to wait for that, but I went ahead and picked up the package a little early :)

    I'm noticing that my cursor is disappearing quite often while I'm editing the TMP stuff in the inspector; in fact, even mousing over that area is making it disappear often (invisible, not lost position-wise).

    I saw that this package has incorporated a few features for its inputfield that I had just finished doing, myself, but with the UI system. I like that. :)

    I tried the FindIntersectingLink but I was able to only get 1 link per text area and I'm unsure if I'm doing something wrong or that is a limitation.

    One feature I want to make for myself, but want to share as an idea/suggestion here is:
    the (option) to have a second buffer that can take marked up tags , keep them for display , but strip the tags for [the second buffer]'s copy. Usage scenario: copy+paste without tags (or at least not ones passed in explicitly for paste).. Something to that effect, without babbling too much. :)

    I made an autoscroll and auto-copy on text selection in the regular UI and look forward to redoing that in this new package. =) The other features I made, I think are already there (and so much more).

    Thanks for the package .. and thanks for anyone who can share some insight/comments. =)
     
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    5,625
    Can you provide more information on this? I have never had any reports on this nor have I observed that before (over several years). I know that the Text Input Box can end up shifting the text left / right which may could result in the cursor being hidden in the margin. Perhaps that is what you are describing.

    The key to the links is to give them a unique Identifier. See the following docs. I also suggest taking a look at example 12a.

    When selecting text, it should be auto scrolling to reveal / show the selection. In terms of auto-copy and this auto scroll, can you provide more insight on how you are using this (ie. use case).

    The raw text which includes the mark up is obviously contained in the .text property. As per the release notes, I just added the function TMP_Text.GetParsedText() which returns the text without the tags. Ie. just the visible / rendered text, With those two you should be able to implement the functionality you seek.
     
  3. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,713
    I'm going to put this at the top so it's not missed.
    This is a wonderful package. I wanted to say thanks one more time. And thanks for your reply.

    That's great to hear about the ParsedText.
    I hadn't actually tried selecting text to see if it scrolled. That was something the regular UI did not do, and that I implemented and I was just sharing that I thought that was useful & wondered if it was here. It's cool to see that it is.
    Edit: Ah, okay.. I see; the inputfield does indeed scroll when text is hidden, however my situation (I should have included before) was with using a ScrollView and having that scroll with the selection update** which does not happen, but is naturally outside of the scope of TMP , I suppose) :)
    I do not think that auto-copying a selection is very normal behaviour, so I would not expect that from TMP. That was something I added, because a game that I play uses that in its chat output box and I thought it was neat. :)

    The docs and example 12a do not give me any help about tag identifiers. I did give them unique identifiers. They returned '0' in both cases (my identifiers were words, like "first" "second"). Off-topic slightly is wondering if each Text UI element stores a separate lookup or if all of the instances are combined. Back on topic, I'm not sure what I was doing wrong.

    I'm loading a scene right now to investigate this margin issue and the cursor disappearing.
    I partially mispoke about it disappearing on mouse-over; this is what I observe:
    Mousing over the "Text Input Box" section makes my mouse pointer disappear, but only in play mode (my cursor's colour seems to be changed to the background or hidden.. impossible to tell visually lol) . If I click, I can see it and moving it outside that area, too. Playmode only, but both in the scene view/game window.
    Probably because it was my first time using it, I had the test scene running all of the time, and that's why i saw it disappearing so much that it stood out & I thought I'd mention it.
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    5,625
    Example 12a uses a different way to detect interactions with characters, words, links, etc. These all still use the utility methods like FindIntersectingLink() but utilize the Unity event system which might be more user friendly.

    When using FindIntersecting... you have to make sure you have a proper reference to the camera or pass null. See the following post on the TMP user forum. I also suggest doing a search on the forum as it might also reveal additional details that I might be overlooking here.

    If you still can't get this working, them please provide me with an example of the script you are using to test this and once I am back from Iceland, I will take a look at it and give you a hand.
     
  5. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,713
    Sure thing. I am reading that post. I did in fact try sending null, as well. (because I was used to doing that for other things in Unity).
    In that case, my results were always -1 lol. So, zero success.

    As for the example 12a, I'm thinking you might mean in the package. I apologize, as I thought you were referring to example 12 on the page you linked (because they are numbered there).. I will check that out when I'm more awake, for sure. :) Thanks.
     
  6. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,713
    One more piece of feedback. I came across a user asking about a TMP inputfield and I was building a little test to help provide a fix for their code, I was access the method "MoveTextEnd" and I noticed that its information in the IDE is less than that of Unity's (it does not describe what the shift means, or even what the method does). What the method does is pretty straight forward, but the shift part is not necessarily something you could guess right, if you didn't already know :)
     
unityunity