Game Development Community

Opening webpages from game

by Andrew H · in Torque Game Builder · 07/30/2011 (7:14 pm) · 5 replies

Is there any way to use an object as a trigger to open up a webpage?

#1
07/31/2011 (5:07 pm)
The question leaves a bit of obscurity regarding what do you need exactly.

Is it to open a web page inside the game, or in a broswer?
What do you mean by object, an in-game object, or a text/bitmap?

The simplest way:

Use the A tag of a guiMLTextCtrl control. That way you'll basically create an hyperlink within the game, that onclick will launch the default browser with the given link.

More info here.
#2
07/31/2011 (5:08 pm)
An in-game object - preferably a bitmap so it opens the browser.

Sorry about my lack of clarity.
#3
07/31/2011 (5:14 pm)
Ah, you need the gotowebpage command.
As in:
gotoWebPage("http://www.garagegames.com");
#4
07/31/2011 (5:17 pm)
Salvaging an Scott post:

The correct syntax in the GUI Editor
gotowebpage("http://www.something2play.com");


The correct syntax in the script file
command = "gotowebpage(\"http://www.something2play.com\");";
#5
07/31/2011 (5:44 pm)
@Novack

Thanks a bunch!