Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Unity 2022.2 is now available as the latest Tech release.
    Dismiss Notice
  3. We are making some changes to the DOTS forums.
    Dismiss Notice
  4. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

You feel that your text is too simple/static? Solution here! Text Action Pro [Released!]

Discussion in 'Assets and Asset Store' started by Breyer, Dec 17, 2014.

  1. Breyer

    Breyer

    Joined:
    Nov 10, 2012
    Posts:
    412

    Text Action Pro
    features:

    • Support multiple links (or "buttons") inside one text component
    • Support animation, creating "wave" for text is possible and many other effect, see video for reference
    • Curve for text: you could make uneven text very easily and visually via curve field
    • Link behave like button in new ui: you could tint color, use fade duration, play animation on click/press/highlight etc., only sprite swap isnt supported
    • Link work even on curved text and multiline except curved AND offsetted multiline link (still fire events but there is huge chance to see incorrect recognize clickable area, see video in thread for reference)
    • You could check which character was clicked with TextWithEvents.lastClickedIndex
    • Semi-automated editor functionality - button is properly generated during typing text into text field; after this you only need some adjusting variables
    • You can animate every link separately: look into Link component inculded in every new button (children of text)
    • You can swap whole text with another text which contain another links
    • source code included
    for only 5$!

    https://www.assetstore.unity3d.com/#!/content/26313

    Getting started
    is very simple: attach TextWithEvents component to UI's GO and paste text into text field; then type <a href=nameOfAction>your link</a>. Look at the end of text field on the pictures below for better explanation.

    WARNING!
    if you need support for color, then you should type color tag BEFORE a href tag or tinting will not work. See pictures again.

    TextActionnormal.png
    TextActionclicked.png


    Feedbacks and bug reports are appreciated ;)


    You need test this before buy?

    then see lite version as .unitypackage linked below

    however: this is limited (mostly animation related features are stripped)


    Known issues:

    • multiline, curved text with offset in x dimension between lines might have incorrect clickable area (you can see this in video) i decided to drop support for this case because no worth effort and potential performance drop
    • if you change existing name of link in text field then you could see that multiple buttons is generated. Solution: delete value of href attribute with ">" then retype new value of href and finish with ">"
     

    Attached Files:

    Last edited: Apr 6, 2015
  2. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,045
    Looks quite cool, though I think you should redo your video at a higher res since it is not possible to make out what you are typing and as that is all the video is showing it would be useful to see what it is you are doing :)
     
  3. Breyer

    Breyer

    Joined:
    Nov 10, 2012
    Posts:
    412
    Oh i see fortunetly still have original uncompressed source so i will try improve res. As a note to what i was typed in video: in pack is example scene with very similar setup and short documentation and getting started, pictures in this thread have exposed text field on link too so if you are courious what should be typed look at these pictures or example scene. Thanks for feedback! ;)
     
    Last edited: Dec 18, 2014
  4. Breyer

    Breyer

    Joined:
    Nov 10, 2012
    Posts:
    412
    Sorry for silence radio but was busy with other projects. I increased contrast a bit, and remember default res is 360p. if u have trouble with pixelation set higher res, maybe help a bit. if you still have trouble then i will upload new video with smaller compression
     
  5. Breyer

    Breyer

    Joined:
    Nov 10, 2012
    Posts:
    412
    version 1.0.1 released

    - fix for ArgumentOutOfRange on attach TextWithEvents
    - added proper support for no color case

    oh and 50% OFF! for 3 days ;). Enjoy!
     
  6. Breyer

    Breyer

    Joined:
    Nov 10, 2012
    Posts:
    412
    2 days left
     
  7. Breyer

    Breyer

    Joined:
    Nov 10, 2012
    Posts:
    412
    last day
     
  8. doktor3d

    doktor3d

    Joined:
    May 7, 2013
    Posts:
    9
  9. Breyer

    Breyer

    Joined:
    Nov 10, 2012
    Posts:
    412
    I answered you via PM: short answer - no because this is designed for text only.

    BTW: I decided to keep lower price and no plan for any off in future. I think 5$ is low enough.
     
  10. asifoncue

    asifoncue

    Joined:
    Dec 8, 2014
    Posts:
    12
    I tried out the free trial awhile back and noticed a bug. If I instantiate my UI, this breaks the textbutton. In the hierarchy, the instantiated gameobject with the textbutton component isn't activated. Is this fixed in the Pro version, or is there a fix for this?
     
  11. Breyer

    Breyer

    Joined:
    Nov 10, 2012
    Posts:
    412
    Sorry completely forgot to refresh trial - new version is much more close to PRO (see new .unitypackage uploaded in first post), most bug fixed only these mentioned in first post + new i found that is solvable by modyfying two float values at 157 and 158 line in TextButton.cs (nothing more and listed below)

    Code (CSharp):
    1. tpi.y += 7f;
    2. tpj.y -= 7f;
    Why i didnt fixed this? because value depend on screen ratio (try random resize Game View in any direction in editor, play with link and you will see about what i say) but unable to find nice working function which will adjust this value properly so you have to adjust these floats manually - if you plan deploy on multiple platform you could use conditional compilation with preprocessor directives
     
  12. ikefrc

    ikefrc

    Joined:
    Jul 3, 2012
    Posts:
    81
    If anyone is looking to change the text during runtime, I've added this fuction to TextWithEvents.cs.
    So after setting the text attribute you need to run it to validate the link tags.

    Code (csharp):
    1.  
    2.   public void DoValidate()
    3.         {
    4.            
    5.             base.text = OnBeforeValueChange(this.text);
    6.             var allTextButtons = GetComponentsInChildren<TextButton>();
    7.             for (var id = 0; id < allTextButtons.Length; id++)
    8.                 allTextButtons[id].WrapperForValidation();
    9.            
    10.         }
    11.  
     
  13. ibps13

    ibps13

    Joined:
    Oct 6, 2012
    Posts:
    113
    Hi Breyer,

    Can you update for 5.2.3 :

    Assets/TextAction/TextWithEvents.cs(163,38): error CS0619: `UnityEngine.UI.Graphic.OnFillVBO(System.Collections.Generic.List<UnityEngine.UIVertex>)' is obsolete: `Use OnPopulateMesh instead.'
     
  14. Discmage

    Discmage

    Joined:
    Aug 11, 2014
    Posts:
    51
    Did anyone manage to sort this particular error out? It's been a while since I've needed this functionality but it would be handy right about now :)
     
  15. thagiwara

    thagiwara

    Joined:
    Oct 9, 2013
    Posts:
    5
    Replace OnFillVBO inTextWithEvents by:
    Code (CSharp):
    1. protected override void OnPopulateMesh(VertexHelper toFill)
    2.     {
    3.         base.OnPopulateMesh(toFill);
    4.  
    5.         List<UIVertex> vbo = new List<UIVertex>();
    6.         toFill.GetUIVertexStream(vbo);
    7.  
    8.         for (int index = 0; index < vbo.Count; index++)
    9.         {
    10.             UIVertex uiVertex = vbo[index];
    11.             uiVertex.position.y += m_CurveData.Evaluate((rectT.rect.width * rectT.pivot.x + uiVertex.position.x) / rectT.rect.width) * curveMultiplier;
    12.             vbo[index] = uiVertex;
    13.         }
    14.     }
     
  16. stimul

    stimul

    Joined:
    Nov 28, 2013
    Posts:
    11
    Breyer, can you update your script?
    Unity 5.4 get this error
    ArgumentOutOfRangeException: Cannot be negative, and should not exceed length of string.
    And on AssetStore last review:


    Nice work but……
    (0 of 0 found this review helpful)
    It is very helpful for me. Ugui's rich text is too pool. I try to add link and image tag in it but i'm not good at coding.

    This project can't work in unity 5.3 because ui.text's interface is changed. I tryed to fix it simply. It works now.

    And I'm trying to add image tag, like </img name=imgname offsetx=0 offsety=0 size=100> or <img offsetx=0 offsety=0 size=100>imgname</img>, but not work yet.
     
  17. tyffchar

    tyffchar

    Joined:
    Mar 6, 2015
    Posts:
    1
    Hi, I am getting this error:

    Can't add 'Image' to clickedHash because a 'Image' is already added to the game object!
    A GameObject can only contain one 'Graphic' component.

    clickedHash is the name of the event I am trying to run. I am trying to have mulitple clickable hashtags.

    This is the type of string I am attemping to use:

    Code (csharp):
    1.  
    2. "<ahref=clickedHash><color=red>{0}</color></a>"
    3.  
    Where {0} is the hash tag

    Could it be because of multiple hashtags? Or something else?