Selectable/"Clickable" Text in UI

Hey guys,

So, I’m working on an Interactive Fiction game and one thing I’d like to do is have certain words within the body of my text “clickable” to essentially bring up a tooltip/seperate text field that gives more information about the word selected.

I don’t know if I’m explaining this correctly, so I’ll try using examples. I’m writing a police procedural. While the player is being presented with the story, a word like “gun” would be clickable to bring up relevant information about the gun… this is to simulate the process of investigation.

So far, I’ve tried Breyer’s Intractable Text but couldn’t get it to work, making the entire body of text an input field and using OnPointerClick/OnPointerDown but that interacts with the entire text field and not with a single word.
I’m rather new to unity and c# so I’m kind of at my wit’s end here.

Thanks in advance

[Help?]

Hi

You can use Texpic.cs from UIExtension package for clickable text.

Though you don’t need to do the hard work, i am attaching a unity package file which contains a sample scene with clickable text, hope this helps you.

note: This package is exported using unity5.5, so please use the latest version of unity.

2874688–210792–ClickableText.unitypackage (15.3 KB)

2 Likes

Thank you so much!

@sushanta1991 Thank you very much!

Thank you very much! Helps me a lot!