Game Development Community

I want to know how to make "clickable" texts

by Jason Doiron · in Torque Game Engine · 09/14/2005 (11:18 am) · 4 replies

I'm very knew to this engine, and I'd like to know this: How to make it so that I can click on specific words in a text, and get a window to pop up and show the dictionary definition of that word. I don't know what the easiest way would be of "hot-spotting" the words like this, but I do know how to work with GUI's in Torque though: how to make a window then close it. Ideally, I would eventually make the window aesthetically pleasing, but that's not necessary right now.

I just figured I'd post this because any one might know a good tutorial or feature of torque that's relevant to this. I'm at a loss of where to start, this engine is so vast, I could learn alot about it in a week, without learning what I actually need to know.

#1
09/17/2005 (8:31 pm)
If you use a GuiMLTextCtrl you can place links in it and have them do script callbacks to trigger this sort of behavior. There are also several tooltip implementations floating around you can use.
#2
09/19/2005 (10:40 am)
Where might I find these implementations?
#3
09/21/2005 (4:49 am)
In the resources section of the site? Try the google search.
#4
09/21/2005 (4:03 pm)
I know for the GUI part.. for a clickable URL you do this, however, I haven't tested this code as-is, so you may need to modify it. Just put it in one of your *Dlg.gui files.

LJR
----------------------------------------------------------------

functions urlDlg::onWake(%this)
{
%text="Click Here";
urlText.setText(%text);
}

function urlText::onURL (%this, url)
{
echo(%this);
echo(%url);
gotoWebPage( %url );
}