How to Make Text Clickable?

I’m currently trying to make an information index for my game, but I want a script to automatically find words in the Text property of a TextLabel and make them clickable (so if a player clicks the WORD it redirects them to another gui)

How would I go about doing this? I don’t know what systems or methods to use.
I plan to have multiple redirects in one description so I can’t just make one big TextButton and overlap it.

Here is an example of what I’m attempting to do.

Any help?

I believe you can put an invisible (background transparency 1 and no text) textbutton in front of the textlabel then when the textbutton is clicked, you redirect the player to the other gui.

1 Like

textlabel: parent textbutton: child (i might be wrong on this idea, cuz im not good at guis + didn’t test it out yet) minor mistake

I’m trying to make a script automatically do this, as my game currently makes the description of the item you’re focused on FROM SCRATCH (using a string value in replicatedstorage)

How about a small textbutton just on top of each of the redirect words?
It may be an issue placing it properly if players have different sized screens and you have the TextLabel set up for percentage of screen size, but if you just make the Textlabel a fixed pixel size it shouldn’t be too bad.
EDIT, I was typing my post while you guys were already mentioning this.

1 Like

I’m sorry I didn’t make it clear in the original post, but I want to do exactly that but with a script.

My game has skills, and each skill you select updates the description GUI based on data from replicated storage.

Putting in data to create buttons for every single highlighted text in every skill would be tedious and inefficient.

I feel this would be doable if you could somehow find the absolute position and absolute size of a piece of text inside of a text label? I’m not sure.

You could try using mouse enter to check if someone hovers their mouse over the textlabel, and then create a way of tracking user input from the player’s mouse afterwards.

I could see this being a potential solution, but how exactly would I get the position of a certain string of text?

The only idea I can think of to get the position of a string within a textlabel is using TextService:GetTextSize, where you may be able to calculate the size of the string and therefore calculate the sizes of certain parts of that string.

most of my guis use textscaled, do you think it will still work?

You might want to use this resource:

Probably the most efficient way to go about this is to make the text you want to be clickable a TextButton. You could make the text the same size and font, and set the background transparency like @DioGotHeaven said. Then you could put a local script that would open said info about the word.

1 Like

Ill look into it later today, thanks!

There is no way for it to be clickable but u could make a invisible part on the blue text and u parent the surface gui into startergui and adornee it to the part.

1 Like