How to make your text clickable 💛 Unity TextMeshPro and the link tag

preview_player
Показать описание
This is how you can make your text box contents clickable in Unity and show a tooltip among other things!
In this video, we'll explore the most mysterious tag in TextMeshPro and how to use it to register clicks on your text: the link tag. This tag can enable you to do a lot more than just display a linked URL - think of it as a way to connect your game's systems, rather than just linking to websites. By having your text clickable, you can display tooltips, jump to new entries in the dialogue and much more!

We'll start with a small example project that shows how to use the link tag to create a tooltip that appears when you click on a word or sprite in a text box. In future videos, we'll delve deeper into the link tag and explore some of the other cool things you can do with it like creating a hyperlinked Dialogue or hovering above tagged parts to display extra infos.

In this tutorial, we'll read the tagged word as a keyword. In the next tutorial, we'll use the keyword to look up more infos and see a system where we have no other way than using the keyword instead of the tagged text :)

Stay tuned for more tutorials on the link tag and how to use it in your Unity projects!

💬 Discord 💛
You are very welcome to join!

🛍️ Store links 🛍️

📖 Chapters 🔖
00:00 Text Mesh Pro's link tag - an overview
00:30 The contents of this tutorial
00:40 Preview of the upcoming tutorial on displaying a tooltip on hover
00:53 The base setup of the tutorial scene
01:54 Syntax of the TextMeshPro link tag
02:08 Script nr 1: The Link Handler For TMP Text Monobehaviour
04:14 Script nr 2: The Tooltip Handler Monobehaviour
05:04 Script nr 3: The Tooltip Info struct
05:14 Completing our Tooltip Handler with Tooltip Infos
05:46 Adding a Close Tooltip function
06:12 Filling the list of Tooltip Infos with relevant information
06:24 Tagging relevant parts of our texts with the link tag
06:32 Adding a style to make our linked texts stand out
06:52 Preview of the upcoming video
07:04 Wrapping up the video

#unitytutorial
Рекомендации по теме
Комментарии
Автор

Thanks so much for these videos, I find them super helpful whenever I'm doing text-based stuff in Unity.

carterx-rzdo
Автор

Sometimes you watch a video and you wonder how such great content isn't more widely viewed, especially when you know it is good quality, useful, clear and well-presented. I am 1.5 years into my Unity development and learning, but there were some good reminders (e.g. using delegates to create decoupled functionality) and some good tips (e.g. making a simple tooltip popup system) that I will be using going forward.

So, I hope you get more views, because students do need this type of content. Thanks

Squared
Автор

Awesome tutorial, thank you!
I still have some of your previous videos to watch but I can't wait for the next one 😁

swalscha
Автор

Thank you this is exactly what I was looking for.

jamesyoung
Автор

You delivered, as promised! Thanks for a very unique tutorial series that will improve my game. If you had a Patreon or tip jar, would love to contribute to your journey.

libiroli
Автор

I spend probably an hour trying to figure out why my text click wasn't registered. Turned out: I had a Canvas in World Space and did not define the Main Camera. T-T - thanks for the in-depth video!

happytofu
Автор

Incredible! But now I want the next video :D

alexleonardkrea
Автор

Hello, I followed your video, but I'm a beginner. I'd like to know if it's possible to have several clickable words in the same tmp text?

analysesjuridiques
Автор

For my game I'm instancing text mesh objects with IPointer in runtime, the event doesn't trigger tho. I know there's nothing wrong in the script because it does work when i placed in anyother object, even objects instanced in runtime thru the editor, the problem seems to be specific to the text instanced in script. Does anyone have any idea of what is going on?

alfredoalfredo
Автор

Очень нужный урок, но у меня не все получается, хотелось бы более подробный урок для новичков

АлексейКолодин-ше
Автор

keep advertising with better thumbnails

__Rizzler__
visit shbcf.ru