Notifications
Clear all

URL in News Articles  

(@gecko64)
Trusted Member Registered

I tried putting in a URL in the URL field in News Article, but it does not appear in the game. How does that work? (And is there any way to have actual links in the News Article text?

ReplyQuote
Topic starter Posted : 19/08/2020 5:48 pm
(@skaredcreations)
Honorable Member Admin

Are you printing the url property of the News object in your UI? I never received issue reports about this, anyway I'll try as soon as I'll come from holidays in the next week.

About URLs in the message property you can find tons of examples in the web to extract the addresses from a string through RegEx, for example:

var linkParser = new Regex(@"\b(?:https?://|www\.)\S+\b", RegexOptions.Compiled | RegexOptions.IgnoreCase);
var matches = linkParser.Matches(Text);
foreach (Match match in matches)
{
    Debug.Log(match.Value);
}

FRANCESCO CROCETTI @ SKARED CREATIONS

ReplyQuote
Posted : 01/09/2020 8:07 pm
Share: