Opening web links from within a game

Started by Netgibbon, Mon 13/02/2017 21:10:42

Previous topic - Next topic

Netgibbon

Is it possible to put an image in an area like the main menu and use something like a hotspot and a click function to open up a web page in a player's browser?
If there is, it'd be cool to know how to do it but if not I suppose I'll have to figure out some other way of achieving this.

Khris

You can open a browser using this plugin: download

1. save and close your game
2. copy the plugin dll into the main AGS folder
3. open the editor and open your game
4. activate the plugin in the project tree

You can now use this command:

int ShellExecute(const string operation, const string file, const string parameters, ShowCommand showCommand = SW_SHOW);

To open a website, use

Code: ags
  // inside hotspot's interact function
  ShellExecute("", "http://website.com", "");

Netgibbon

Thanks for the reply. I'll give it a shot :-D

SMF spam blocked by CleanTalk