Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   thiso.catchevent question. (https://forums.graalonline.com/forums/showthread.php?t=134264769)

Gunderak 10-11-2011 08:15 AM

thiso.catchevent question.
 
hello forum.
anyway what im making is a staff tools menu and it has a few images and a text edit at the bottom, and im wonderint how i would change the text depending on what the mouse is over, iv'e tried doing this
PHP Code:

thiso.catchevent(name"onMouseEnter""onTextChange""Drag Tool"); 

and then
PHP Code:

function onTextChange(){
Selected_Text.text params[1];


But thiso.cahchevent doesnt support params...
is there anyway without making 1000 diffarent functions for possibilities of what the text can be?

cbk1994 10-11-2011 08:26 AM

Set a variable on the control, then access it later. The first parameter will be the object that called it.

PHP Code:

new GuiShowImgCtrl("Tool_RandomImage") {
  
width 32;
  
height 32;
  
  
image "block.png";
  
this.title "A random staff block";
  
thiso.catchEvent(this"onMouseEnter""onHoverOverTool");


PHP Code:

function onHoverOverTool(temp.control) {
  
Tool_SelectedText.text temp.control.title;



Gunderak 10-11-2011 08:48 AM

Thanks a heap!


All times are GMT +2. The time now is 10:33 AM.

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