How to open a URL or link from a text box with Unity TextMeshPro 💛

Опубликовано: 19 Декабрь 2022
на канале: Christina Creates Games
6,591
97

#unitytutorial
Opening a link to awebsite (URL) by clicking on a text in a TextMeshPro Text box is simple! It works by utilizing the link-tag provided by Text Mesh Pro and we need to check if the tagged element at our mouse position actually contains a link tag, for which we will use a Link Handler we created in a different video.

Just add a hand full lines of code to the Link Handler we created in this video:    • How to make your text clickable 💛 Uni...   (that one teaches you how to make parts of your text clickable. If you really only need it for a link, just remove the event at the bottom of the script.)

Making clickable URLs is only one of the possible use cases of the link tag!

💬 Discord 💛
You are very welcome to join!
  / discord  

🛍️ Store links 🛍️
If you'd like to support my channel, consider using my affiliate link when buying cool stuff in the Unity asset store: https://assetstore.unity.com/?aid=110... [Affilate link]
Or on Humblebundle: https://www.humblebundle.com/?partner... [Affiliate link]
Or in the Synty Store: https://syntystore.com/98327 [Affiliate]

🎮 Play my games on Itch.io 🎮
https://christinacreatesgames.itch.io

📖 Chapters 🔖
00:00 How our clickable URL will look and behave using TextMeshPro
00:16 How the system is set up
00:33 Using the LinkHandler as a base
00:50 The code for checking if the link-tagged element contains a URL and if it does, open it in the browser
01:14 Wrapup


Смотрите видео How to open a URL or link from a text box with Unity TextMeshPro 💛 онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал Christina Creates Games 19 Декабрь 2022. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 6,591 раз и оно понравилось 97 посетителям.