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
Getting started is very simple: attach TextWithEvents component to UI’s GO and paste text into text field; then type your link. 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.
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 “>”
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
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!
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
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?
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)
tpi.y += 7f;
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
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.
public void DoValidate()
{
base.text = OnBeforeValueChange(this.text);
var allTextButtons = GetComponentsInChildren<TextButton>();
for (var id = 0; id < allTextButtons.Length; id++)
allTextButtons[id].WrapperForValidation();
}
Assets/TextAction/TextWithEvents.cs(163,38): error CS0619: UnityEngine.UI.Graphic.OnFillVBO(System.Collections.Generic.List<UnityEngine.UIVertex>)' is obsolete: Use OnPopulateMesh instead.’
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 imgname, but not work yet.