Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Html -> GS2 (https://forums.graalonline.com/forums/showthread.php?t=134265401)

Alpho 12-24-2011 04:48 AM

Html -> GS2
 
Is there any way to have an image scripted with html, when clicked, jumps to a gs2 function that is somewhere else in a script?

Example:
PHP Code:

<a href=onTest>Click Here</a>

function 
onTest() {
  
player.chat "It works!";


Of course the above wouldn't work, but I think you guys get what I mean.:noob:

cbk1994 12-24-2011 05:02 AM

Yes. Set htmllinks = false then use the onURL event, e.g.

PHP Code:

new GuiMLTextCtrl("Test") {
  
htmllinks false;
  
text "This is a <a href=\"foo\">link</a>!";


PHP Code:

function Test.onURL(temp.url) {
  echo(
"You clicked: " temp.url);




All times are GMT +2. The time now is 01:55 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.