Search Unity

TextMesh Pro - Advanced Text Rendering for Unity - Beta now available in Asset Store

Discussion in 'Works In Progress - Archive' started by Stephan-B, Feb 11, 2014.

Thread Status:
Not open for further replies.
  1. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    TIP: Make sure the duplicated Material Presets follow the naming convention by using the name of the font such as "ARIAL" for ARIAL otherwise the Material Preset will not be visible in the Material Preset pulldown in the Inspector panel.
     
    TurboNuke likes this.
  2. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Added <rotate=xx.x> tag just for fun.

    Here is an example


    In the example above the raw text is using something like "Feeling <rotate=10>D<rotate=-8>i..."
     
    fffMalzbier and TurboNuke like this.
  3. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Working on adding a new variant to the <sprite> tag in TMP. This new variant will make it possible to add animated sprites inline with the text. Below is a first simple example.



    In the above example the raw text was "Animated <sprite anim="0,8,30"> Sprites".

    The format for this new sprite tag attribute is <sprite anim="first frame, last frame, frame rate">.
     
    Lednar likes this.
  4. Igorexa

    Igorexa

    Joined:
    Sep 25, 2014
    Posts:
    23
    After upgrade to new version in runtime get error message:

    get_isActiveAndEnabled can only be called from the main thread.
    Constructors and field initializers will be executed from the loading thread when loading a scene.
    Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
    UnityEngine.EventSystems.UIBehaviour:IsActive()
    TMPro.TextMeshPro:SetVerticesDirty() (at Assets/TextMesh Pro/Scripts/TextMeshPro.cs:217)
    TMPro.TMP_Text:set_text(String) (at Assets/TextMesh Pro/Scripts/TMP_Text.cs:71)
    <GetRating>c__Iterator9E:<>m__CB(Task`1) (at Assets/My/Scripts/XP/GiftArena.cs:218)
    System.Threading.Tasks.<>c__DisplayClass1:<Post>b__0(Object)


    On older version i set text to TextMeshPro inside of the asynchronous call.
     
  5. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I believe this is the result of changes Unity made in 5.4 which now prevents using API functions outside of the main thread which I guess would be happening when calling these functions async.

    Can you email me a simple repro that results in this error so I can see if this is something that I would need to handle differently somewhere or simply the result of Unity's latest changes.
     
  6. senwj

    senwj

    Joined:
    Mar 10, 2015
    Posts:
    3
    Buy your little birds with this plugin, do not support Chinese dynamic text, with up unhappy. Do you have a lot of limitations, which I need to be able to use is dragged into a font, you can do this?
     
  7. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    TextMesh Pro does not support Dynamic Fonts which is actually not necessary to support languages with large character sets like Chinese, Japanese and Korean.

    TextMesh Pro includes a Font Fallback system which makes it possible to distribute characters into as many font assets as necessary which in turn makes it possible to access even more characters than is possible with Unity's Dynamic Font.

    When it comes to localization and support for languages like Chinese, the process would be as follows:

    (1) Create a Primary SDF Font Asset which will contain all the "known" Chinese characters used in your project. Most Studios use language files which contain all the known text and for any given language in their project. Using these files, you can use the "Character from File" option of the Font Asset Creator to create an SDF Font Asset that will contain all those characters for a given language or groups of languages (as many can be grouped). Given that most projects rarely include more than 1,000 characters for any given language, those can easily be included in a single SDF Font Asset.

    (2) Then for the "unknown" text / characters (resulting from user input for example), you will be creating additional SDF Font Assets which in the case of Chinese, will include the remaining characters found in the Table of General Standard Chinese Characters.

    Essentially, you will end up with your Primary SDF Font Asset which contains all the known Chinese characters. You will then have (2) to (3) additional Fallback Font Assets. The first fallback will contain the first 3500 characters from this list (minus those already in the primary). The second fallback will contain the next 3000 minus those already in your primary and lastly (if still needed) the third fallback will include the 1805 minus again those included in your primary font asset.

    See the following video which covers the Font Asset Creation process as well as this information.

    Since the release of the Fallback Font System in TextMesh Pro, this is the recommended workflow which appears to work best for most of my users.

    Having said that, I still have users for CJK who include all the known character in their project in their Primary SDF Font Asset but still rely on Unity's Dynamic Font System and Input Field for user input. Given user input text tends to be smaller and plain, this appears to work well for them.

    I have a lot of customers ranging from indie developers to large studios who use TextMesh Pro for localized projects in Chinese, Japanese and Korean. There are also several other posts of mine covering this information but if you need further assistance with this, feel free to reach out to me via email or post on the TextMesh Pro user forum. I am here to help.
     
  8. senwj

    senwj

    Joined:
    Mar 10, 2015
    Posts:
    3
    Thanks,You next version supports Chinese dynamic text it? Text should support many fonts, or else this will make you this too has its limitations, all of the Chinese market will be used less, and this is the loss of your product.
     
  9. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I am not planning on adding support for a full dynamic system as there are too many potential downsides like run time performance overhead, limitation on how many characters can actually be supported / added into a single texture and unpredictable rendering results on some devices and other issues which Unity users have run into in the past.

    Having said that and as per this post, I am planning on adding support for a Dynamic Fallback System which would allow users to continue to use pre-created / static SDF Font Assets for all the known text in their project thus providing best performance and consistent rendering across all devices and then in the case of user input where the text / characters are unknown use this new Dynamic Fallback System which would only have to handle few characters and given this would mostly happen during user input which is slow compared to processing / rendering time, would mask the performance overhead of such system.

    In terms of Font support, TextMesh Pro supports as many fonts as you want. There is no limitation on the number of fonts that you can use. TextMesh Pro can even use .otc font files which are mostly used for CJK and this is something Unity does not currently support.

    Keep in mind that you do have to create at least (1) SDF Font Asset per font file (ie. Arial, Impact, Helvetica, NotoSans, etc) but once this is done, this SDF Font Asset can be used to render the text cleanly at any point size and resolution and with the use of Material Presets, provide for an unlimited number if visual variations which is something that is not possible with Unity's Dynamic Font system.
     
  10. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Added the ability to use Positive or Negative Frame rate to control playback direction with the sprite tag anim attribute.

    Here is an example



    This is the text from the Text Input Box
    Now, I need to get some nice animated sprite examples from my users to show this off given my artistic skills are ... horrible. :(
     
    Peter77 likes this.
  11. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    I'd like to have something similar to the "Old Computer Terminal" example scene in my game, but have text continue to scroll off the top of the text area.

    The example scene doesn't support that, so is there a way to tweak it work that way or is there some other trick to that?

    I got the "typewriter" effect working, but haven't figured out how to prevent the text from bleeding past the top of the text area. Ideally, the text would initially start at the top, and only start scrolling after the screen fills up (like a command prompt), but that would be a bonus. I've tried several things, but haven't been able to get it to work yet.

    To visualize it, here's what the example scene looks like with more text than will fit. So I'm trying to have the text truncated at the top so that it stays within the black area while more text streams in at the bottom.
    https://dl.dropboxusercontent.com/u/28342849/Unity_misc/TextMesh Pro/CommandPrompt.PNG
     
  12. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Why not just use a 2D Rect Mask which would result in the text going outside the view area to disappear? I think then all you would need to implement is a method to track when the text fills the view area (ie. gets to the bottom) and then begin to scroll it up one line at a time. I think something along those lines could work.

    EDIT: By tracking the maxVisibleCharacter, you would know which line is currently being revealed and then scroll up one as you get to the next line.
     
  13. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    I'm using NGUI, so I don't think I can "mix and match" with a Unity UI element like 2D Rect Mask. NGUI has a "panel" component that can easily be set up for clipping a particular region, but of course it only clips other NGUI elements.

    EDIT: I just discovered that NGUI has a Typewriter component for doing the typewriter effect and it works with the NGUI scroll region component. So maybe in this specific case, using NGUI UILabel along with a UIPanel would actually be easier. That hadn't even occurred to me, since TMP tends to be the winner in terms of text handling (love the page feature, for instance) and of course crisp text rendering.
     
    Last edited: Sep 21, 2016
  14. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    You should be able to use the NGUI Clipping with the normal TMP component. You will have to define the clipping region in the debug panel section of the material (_ClipRect).

    There are a few posts covering Clip region with NGUI and TMP here is one. http://digitalnativestudios.com/forum/index.php?topic=330.msg6283#msg6283
     
  15. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Hehe, I went down the path of editing the .cs file like the post says, pulling down the attached script, and puzzling over what the equivalent shader line in TMPro_SDF.shader would be. But then it clicked what you were saying about the Debug section of the material

    I didn't even know there was a Mask feature in the Material -> Debug section. I don't actually need to use NGUI clipping via a panel, I just can't use 2D Rect Mask within the NGUI structure is all. So that's perfect! I just set the Mask to "Mask Hard" and set a width and height of the Mask Bounds by eyeballing the editor preview.

    I ended up not getting fancy with the text starting at the top and then scrolling. I just did it like your computer console example and it looks great as is really. Easy.

    Thanks!
     
  16. Eruheran4

    Eruheran4

    Joined:
    Jan 6, 2013
    Posts:
    19
    Can somebody explain me how to realise a bezier curved text?
    As reference a classic hearthstone card title:
     
  17. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Included with TextMesh Pro is the WarpTextExample.cs script which curves the text. This uses a Unity Animation Curve but could be adapted to use other methods to curve the text like bezier.

    Several TMP users have also implemented their own methods. Here is a link to one of those on the TMP User Forum.
     
  18. Games-Foundry

    Games-Foundry

    Joined:
    May 19, 2011
    Posts:
    632
    Looks like there's a shader compilation issue in 1.0.54 when running DirectX 9 on 5.2.2p3 (text is showing up pink). I'm going to look into it in the morning. Just giving you a heads up.

    Code (CSharp):
    1.  
    2. Shader error, D3D9 shader assembly failed with: (3): error X2000: syntax error : unexpected token 'e'
    3.  
    4. Shader Assembly: vs_3_0
    5. def c42, 0, 1.5, 1, 0.5
    6. def c43, -2e+010, 2e+010, 0.000244140625, 4096
    7. def c44, 0.001953125, 2, 0.25, 0
    8. dcl_position v0
    9. dcl_normal v1
    10. dcl_color v2
    11. dcl_texcoord v3
    12. dcl_texcoord1 v4
    13. dcl_position o0
    14. dcl_color o1
    15. dcl_texcoord o2
    16. dcl_texcoord1 o3
    17. dcl_texcoord2 o4
    18. dcl_texcoord3 o5.xyz
    19. dcl_texcoord4 o6
    20. dcl_color1 o7
    21. mov r0.zw, v0
    22. add r0.x, c31.x, v0.x
    23. add r0.y, c32.x, v0.y
    24. dp4 o0.x, c0, r0
    25. dp4 o0.y, c1, r0
    26. dp4 o0.z, c2, r0
    27. dp4 r1.x, c8, r0
    28. dp4 r1.y, c9, r0
    29. dp4 r1.z, c10, r0
    30. dp4 r0.z, c3, r0
    31. add r1.xyz, -r1, c17
    32. nrm r2.xyz, r1
    33. mul r3.xyz, c12, v1.y
    34. mad r3.xyz, c11, v1.x, r3
    35. mad r3.xyz, c13, v1.z, r3
    36. nrm r4.xyz, r3
    37. dp3 r0.w, r4, r2
    38. mov r2.xy, c18
    39. mul r2.zw, r2.xyxy, c4.xyxy
    40. add r1.w, r2.w, r2.z
    41. mul r1.w, r1_abs.w, c39.x
    42. rcp r3.x, r1.w
    43. mul r2.xy, r2, c5
    44. add r1.w, r2.y, r2.x
    45. mul r1.w, r1_abs.w, c40.x
    46. rcp r3.y, r1.w
    47. mul r2.xy, r0.z, r3
    48. mul r2.xy, r2, r2
    49. add r1.w, r2.y, r2.x
    50. rsq r1.w, r1.w
    51. mul r2.x, c38.x, v4_abs.y
    52. mul r1.w, r1.w, r2.x
    53. mul r2.x, r1.w, c42.y
    54. mov r2.z, c42.z
    55. add r2.y, r2.z, -c41.x
    56. mul r2.y, r2.y, r2_abs.x
    57. mad r2.w, r1.w, c42.y, -r2.y
    58. mad r0.w, r0_abs.w, r2.w, r2.y
    59. mad r0.w, r1.w, -c42.y, r0.w
    60. abs r1.w, c7.w
    61. sge r1.w, -r1.w, r1.w
    62. mad r2.y, r1.w, r0.w, r2.x
    63. rcp r0.w, r2.y
    64. sge r1.w, c42.x, v4.y
    65. mov r2.x, c27.x
    66. add r2.x, -r2.x, c28.x
    67. mad r1.w, r1.w, r2.x, c27.x
    68. mov r2.x, c29.x
    69. mul r3.z, r2.x, c19.x
    70. mul r3.z, r3.z, c42.w
    71. rcp r3.w, c38.x
    72. mad r2.w, r1.w, r3.w, r3.z
    73. add r1.w, -r2.w, c42.w
    74. mad o3.z, r0.w, c42.w, r1.w
    75. mul r0.w, r0.w, c42.w
    76. mad r1.w, c21.x, -r2.x, r2.z
    77. mad r1.w, c20.x, -r2.x, r1.w
    78. mad r0.w, r1.w, c42.w, -r0.w
    79. add o3.x, -r2.w, r0.w
    80. mov o3.yw, r2
    81. mul o7.xyz, c22.w, c22
    82. mov r2.x, c30.x
    83. mul r0.w, r2.x, c26.x
    84. mad r0.w, r0.w, r2.y, c42.z
    85. rcp r0.w, r0.w
    86. mul r0.w, r0.w, r2.y
    87. lrp r1.w, r0.w, -r2.w, -c42.w
    88. mul r2.y, r2.x, c25.x
    89. mul r2.y, r0.w, r2.y
    90. mov o6.z, r0.w
    91. mad o6.w, r2.y, -c42.w, r1.w
    92. mul r0.w, c43.z, v4.x
    93. frc r1.w, r0.w
    94. add r2.z, r0.w, -r1.w
    95. mad r2.w, r2.z, -c43.w, v4.x
    96. mul o2.zw, r2, c44.x
    97. mov r4.x, c43.x
    98. max r4, r4.x, c33
    99. min r4, r4, c43.y
    100. mad r0.xy, r0, c44.y, -r4
    101. add o4.xy, -r4.zwzw, r0
    102. mov r2.z, c44.z
    103. mul r0.x, r2.z, c34.x
    104. mul r0.y, r2.z, c35.x
    105. mad r0.xy, r0.z, r3, r0
    106. mov o0.w, r0.z
    107. rcp r0.z, r0.x
    108. rcp r0.w, r0.y
    109. mul o4.zw, r0, c44.z
    110. dp3 o5.x, c14, r1
    111. dp3 o5.y, c15, r1
    112. dp3 o5.z, c16, r1
    113. mul r0.x, r2.x, c23.x
    114. mul r0.x, -r0.x, c38.x
    115. rcp r0.y, c36.x
    116. mul r0.x, r0.y, r0.x
    117. mul r0.z, r2.x, c24.x
    118. mul r0.z, -r0.z, c38.x
    119. rcp r0.w, c37.x
    120. mul r0.y, r0.w, r0.z
    121. add o6.xy, r0, v3
    122. mov o1, v2
    123. mov o2.xy, v3
    124. mov o7.w, c22.w
    125.  
    126.  
    127.  
     
    Last edited: Sep 29, 2016
  19. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Keep me posted on this as this is the first report of the sort.

    Which TMP shader are you using?

    I am surprised given I made some minor improvements to the shaders in the latest release to reduce their varying count which should have reduced their requirements.

    Update
    I am able to reproduce the issue and looking into it. I am not sure why we are getting these Unity shader compiler errors.

    Update II
    Same shaders are working fine in DX9 in Unity 5.3 & 5.4.
     
    Last edited: Sep 29, 2016
  20. thomas_triplefun

    thomas_triplefun

    Joined:
    Sep 24, 2014
    Posts:
    25
    Hi there, I've got an exception on my app, there is the log:

    Code (CSharp):
    1. ClientLogger: NullReferenceException: Object reference not set to an instance of an object: TMPro.TMP_InputField.ActivateInputFieldInternal ()
    2. TMPro.TMP_InputField.LateUpdate ()
    I use Text Mesh Pro v0.1.54 Beta 3
     
  21. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I have made a good amount of changed on the InputField between 0.1.54 Beta 3 and the current release 1.0.54.52. I would suggest you update to the latest release of TMP and make sure you review the release notes / update notes first. However, if you are at a critical time and can't upgrade, take a look at the most recent TMP_InputField.cs and compare it with your current version as it should enable you to find the specific changes relevant to the section of code where you are running into this issue.
     
  22. thomas_triplefun

    thomas_triplefun

    Joined:
    Sep 24, 2014
    Posts:
    25
    Thank's, I upgrade to the latest release and let you know if I find something.
    Thank you for your quickly answer.
     
  23. MrMatthias

    MrMatthias

    Joined:
    Sep 18, 2012
    Posts:
    191
    It freezes Unity from time to time, only solution is to delete TMPro, restart Unity and import it again and work till it freezes again. Latest TMPro version from the store. Unity 5.4.03

    Edit: during the freeze i can only delete the TMPro folder as admin
     
    Last edited: Oct 6, 2016
  24. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    There is an issue that was introduced in the latest releases of Unity where during the build process, font assets can get corrupted. This is not limited to TMP as other assets can also be affected. It seems to be related to assets which contain sub assets and asset bundles.

    I have a few users affected by this but have not been able to reproduce it on my end. If you are able to reliably reproduce this, I would greatly appreciate an email with a repro project.

    The following user post on the TMP User Forum should provide for a work around.
     
  25. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Just learned that TextMesh Pro has been selected as a finalist for the Unity Awards for 2016 in the Asset Store category.

    I am honored TextMesh Pro has been selected and most grateful for all my users who made this possible. Once again, thank you all so much for your amazing support :)
     
    fffMalzbier, TurboNuke and hopeful like this.
  26. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    In conjunction with the addition of the ability to use Animated Sprites in the next release of TMP, I added the ability to reorder the sprites in the Sprite Asset.



    This way regardless of where in the sprite texture atlas the actual sprites are located, you will be able to reorder the sequence for the sprites to animate correctly.
     
  27. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Link Text Overflow Mode
    I am working on a new text overflow mode which makes it possible to link several text objects together to allow text to flow from one object to another. This will make it easy to create text columns and more sophisticated layouts.

    This new feature works with existing rich text tags including the Multi Font & Sprites and Style tag.

    Here is a quick example showing this new overflow mode.



    Link to GIF http://imgur.com/6skGN0c
     
    julianr likes this.
  28. MrMatthias

    MrMatthias

    Joined:
    Sep 18, 2012
    Posts:
    191
    Thanks, verifying asset saving prevents it.
    Congrats on the unity award!
     
  29. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Here is a simpler example of the Text Overflow - Linked mode. I guess the previous GIF was too big in size for the forum.

     
    julianr, MrMatthias and zyzyx like this.
  30. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Working on adding support for a Vertical Scrollbar to the TMP Text Input Field

     
    julianr likes this.
  31. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Vertical Scrollbar
    As per my previous post, I added the ability to use a Vertical Scrollbar with the TMP Input Field. This new feature will be available in the next release which will be shortly after Unite in Los Angeles next week.

    Here is an updated video showing the new functionality and screen shot of the new Inspector Panel / Options.



     
    ilmario, Games-Foundry and MrMatthias like this.
  32. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    PREVIEW - Linked Text Objects
    Another feature that I have been working on for the next release of TextMesh Pro is a new Text Overflow mode which makes it possible to link several text objects together where the text that exceeds one text container will flow to the next text object in the link.

    As you can see in the example blow, as I resize the first text object, the text automatically re-flows through the linked text objects.



    Since there appears to be an issue on the Unity Forum with GIFs, here is a still image and link to the animated GIF in case you are unable to see the one above.

     
    Last edited: Oct 29, 2016
    MrMatthias and TurboNuke like this.
  33. bradbecker

    bradbecker

    Joined:
    Dec 26, 2014
    Posts:
    130
    Awesome! Does that also work with your pagination feature?
     
  34. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    It does not since like Truncate, Ellipsis, etc this is an additional type of text overflow mode. Plus I am not certain how this would sort of behave if it worked with pagination (ie. conceptually that is).
     
  35. KOP3R

    KOP3R

    Joined:
    Feb 18, 2015
    Posts:
    13
    Hello, I'm trying to achieve this effect:



    My effect should be similiar but instead of fade-in each letter I would like to get fade-in each line.
    So lines can show up in order from up to down.
    I'm trying to do this with TextMeshPro but is this even possible without much effort?
     
  36. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Take a look at the following example script which fades text one character at a time over a certain number of characters even changing their vertex colors.

    The same technique could be used to fade text per line where instead of iterating over each character, you would iterate over each line.

     
  37. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    This image may not look like much...



    Until you pay close attention to what characters are being requested.

    Here is an image of the Sprite Asset Editor which now includes a new field "Unicode" value for each sprites.



    Basically, TextMesh Pro will now be able to use a Sprite Asset as a fallback. So when the requested character is not found in the primary font asset or any of the assigned fallbacks, TMP will now look into the Default Sprite Asset for a sprite with the corresponding Unicode value.
     
    ilmario likes this.
  38. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    *** New *** TextMesh Pro Product Highlight Video

     
  39. bradbecker

    bradbecker

    Joined:
    Dec 26, 2014
    Posts:
    130
    Is the Linked Text objects feature ready to be released yet? Is it in beta?
     
  40. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    The Linked Text feature is not available yet but will be included in the next release which I am trying to release within the next 7 to 10 days.

    I might have a beta available sooner on the TextMesh Pro user forum so make sure you do register there if you have not done so already.
     
  41. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    I would like to express my gratitude to all TextMesh Pro users and to wish everyone a Happy Thanksgiving.
     
    fffMalzbier likes this.
  42. Redrag

    Redrag

    Joined:
    Apr 27, 2014
    Posts:
    181
    I bought TMP mainly to do hyperlinks. But it looks like I have to hack into TMP_TextSelector_A (or B??) None of it looks very intutive.. Could you send a simple script which implements clicking on a link?

    The below doesn't seem to work/ Am I missing something?

    using UnityEngine;
    using System.Collections;
    using UnityEngine.EventSystems;
    using UnityEngine.Events;

    public class TextMeshProHandler : MonoBehaviour, IPointerClickHandler{

    public void OnPointerClick(PointerEventData eventData)
    {
    print("Hello");
    }
    }
     
    Last edited: Nov 25, 2016
  43. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    That should work depending on whether you are using the normal or UI TMP text object. See example 16 included with TextMesh Pro which includes an example using both text components. The example also shows possible interactions with words and characters as well in addition to links. Hold down shift to interact with characters.
     
  44. Redrag

    Redrag

    Joined:
    Apr 27, 2014
    Posts:
    181
    I've found out how to click on a link and get a string ID back - hooray! Only taken me 2 hours! Surely you just need a simple REUSABLE event handling script without all the implementation rubbish - which just obscures what is quite simple..

    Update - I have intercepted a link click on your Example 16. But in my own scene I can make nothing work. Even the debug script is not firing. I have used the UI prefab. I think if you can't send me something to make a simple clickable link work I will have to ask for a refund.
     
    Last edited: Nov 26, 2016
  45. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Feel free to share / post examples on the TextMeshPro user forum which you feel would be beneficial to other users.
     
  46. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    715
    Hi!

    I'm trying to achieve a Vintage extruded shadow effect for our game typography.

    This is the desired effect:



    I tried many combinaisons of TMPro settings, but the only one that works is to generate an array of Text Meshes / copies of the original text, all layered behind the original; but that is no good for performance (I'm using uGUI and canvases updates can be quite hard on the machine when text changes).

    (1) Is there any way to edit the generated atlases outside of Unity?
    (2) Or to achieve the above result with some magic settings?
    (3) Or to have shadows that aren't restricted to -1, 1 range of distance?

    Any help on this would be greatly appreciated!

    Cheers and keep up the good work, TMPro is amazing!
     
  47. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    You should be able to achieve that dynamically with the Underlay. As per the information provided in the following video and FAQ question 11, the range of material properties is determined by the ratio of Sampling Point Size and Padding when creating the Font Asset.

    Can you provide a link to the font file you are using?
     
  48. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    As per example 16 which contains an example of clickable Characters, Words and Links and for both type of TextMesh Pro components, this should be working.

    I will need more information from you in terms of your scene / script as to why it might not be working in your case. If you are using a simple test scene, just email that to me.

    Since you just updated your previous post, I did not get any notification of this. Just reach out to me via email or post on the TextMeshPro user forum, this way I won't miss updates from you and we will be able to keep the conversation focused on your needs.

    Like I said this should be working, we just need to figure out why it is not in your implementation. I am here to help so we will get this working for you.
     
    Last edited: Nov 28, 2016
  49. patrick-kulling

    patrick-kulling

    Joined:
    Feb 18, 2016
    Posts:
    7
    Hey Stephan,
    I am a big fan of your product & it solves a lot of issues for us.

    I was wondering if TextMesh Pro supports the ability to reference to a SpriteAsset that comes from an AssetBundle. We need to distribute new SpriteAssets over the air (e.g. via the AssetBundle), but I am unsure if this can be achieved.

    Best,
    Patrick
     
  50. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Loading Sprite Assets via AssetBundles should work fine. The only part that I am uncertain as I have not had much time to work with AssetBundles is accessing the sprite asset at run time since TextMesh Pro expects those to be located in a Resources folder as specified in the TMP Settings file.

    Assuming the above is an issue, the next release of TextMesh Pro will include the ability to assign a default sprite asset to an object where in this case its location doesn't matter.

    Code (csharp):
    1.  
    2. /// <summary>
    3. /// Default Sprite Asset used by the text object.
    4. /// </summary>
    5. public TMP_SpriteAsset spriteAsset
    6.  
    Assuming your text references these sprites by name or index, this new property should work nicely.

    P.S. I am currently testing the new release so unless something new is reported, it should be available on the TMP user forum within the next few days.
     
Thread Status:
Not open for further replies.