Does clickable text call method or just open hyperlink only?

14 views
Skip to first unread message

baop...@gmail.com

unread,
Feb 8, 2017, 5:33:18 PM2/8/17
to Developer Support
Hello there,

I'm looking for a component that helps me build an app which is somewhat like a eBook, so I wonder if the highlighted text on this component can call a method (show images, videos, etc.) or it just can only open the site?

Thank you!

Developer Support

unread,
Feb 8, 2017, 5:43:51 PM2/8/17
to Developer Support
Hi there! Links emit a variety of events (e.g., Clicked, Pressed, Released, Entered, Exited) and you can subscribe to them programmatically link any other UnityEvent, or via the inspector as persistent listeners (see e.g., this page in the HyperText documentation). There is an optional property on HyperText components, OpenURLPatterns, which basically just automatically registers clicked event handlers to parse the link's name attribute for a web address and open it in a browser, but you can literally do whatever you want in your own event handlers.
Reply all
Reply to author
Forward
0 new messages